org.util.xml.parse.policy
Class XMLParserPolicy

java.lang.Object
  extended by org.util.xml.parse.policy.DefaultParserPolicy
      extended by org.util.xml.parse.policy.XMLParserPolicy
All Implemented Interfaces:
ParserPolicy

public class XMLParserPolicy
extends DefaultParserPolicy

Author:
masaru

Constructor Summary
XMLParserPolicy()
           
 
Method Summary
 Element allowElement(Element element)
          called when element is detected.
 boolean checkEndTag()
          if true, check open tag key and close tag key.
 boolean forceEmptyTag(java.lang.String key)
          Basicly, all the tag must open and close.
 java.lang.String selectEncoding(java.lang.String last_tag_key)
          if encoding cannot be detected by first line of document, this method will be called.
 
Methods inherited from class org.util.xml.parse.policy.DefaultParserPolicy
finished, getInnerPolicy, throwExceptionIfDocumentHasError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParserPolicy

public XMLParserPolicy()
Method Detail

selectEncoding

public java.lang.String selectEncoding(java.lang.String last_tag_key)
Description copied from interface: ParserPolicy
if encoding cannot be detected by first line of document, this method will be called. while returned null, this method will be called every time that tag detected.

Specified by:
selectEncoding in interface ParserPolicy
Overrides:
selectEncoding in class DefaultParserPolicy

checkEndTag

public boolean checkEndTag()
Description copied from interface: ParserPolicy
if true, check open tag key and close tag key.

Specified by:
checkEndTag in interface ParserPolicy
Overrides:
checkEndTag in class DefaultParserPolicy

forceEmptyTag

public boolean forceEmptyTag(java.lang.String key)
Description copied from interface: ParserPolicy
Basicly, all the tag must open and close. But if this method return true, opentag will be considerd to empty tag. So end tag will disregarded.

Specified by:
forceEmptyTag in interface ParserPolicy
Overrides:
forceEmptyTag in class DefaultParserPolicy

allowElement

public Element allowElement(Element element)
Description copied from interface: ParserPolicy
called when element is detected.

Specified by:
allowElement in interface ParserPolicy
Overrides:
allowElement in class DefaultParserPolicy