org.util.xml.parse.policy
Interface ParserPolicy

All Known Implementing Classes:
DefaultParserPolicy, HTMLDiv, HTMLImage, HTMLImg, HTMLObject, HTMLObject, HTMLParserPolicy, HTMLText, HTMLText, XMLParserPolicy

public interface ParserPolicy

Author:
masaru

Method Summary
 Element allowElement(Element element)
          called when element is detected.
 boolean checkEndTag()
          if true, check open tag key and close tag key.
 boolean finished()
           
 boolean forceEmptyTag(java.lang.String key)
          Basicly, all the tag must open and close.
 ParserPolicy getInnerPolicy(Element element)
          return handler that handle this element
 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.
 boolean throwExceptionIfDocumentHasError()
          Throw exception if document has error.
 

Method Detail

throwExceptionIfDocumentHasError

boolean throwExceptionIfDocumentHasError()
Throw exception if document has error. In case this method returns false, if there are errors, skip some texts and continue parsing.


checkEndTag

boolean checkEndTag()
if true, check open tag key and close tag key.


selectEncoding

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. while returned null, this method will be called every time that tag detected.


forceEmptyTag

boolean forceEmptyTag(java.lang.String key)
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.


getInnerPolicy

ParserPolicy getInnerPolicy(Element element)
return handler that handle this element


allowElement

Element allowElement(Element element)
called when element is detected.


finished

boolean finished()