org.util.xml.parse.policy
Class HTMLParserPolicy
java.lang.Object
org.util.xml.parse.policy.DefaultParserPolicy
org.util.xml.parse.policy.HTMLParserPolicy
- All Implemented Interfaces:
- ParserPolicy
public class HTMLParserPolicy
- extends DefaultParserPolicy
- Author:
- masaru
Method Summary |
Element |
allowElement(Element element)
called when element is detected. |
boolean |
checkEndTagMatch()
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
forse_empty_tag_list_
protected java.lang.String[] forse_empty_tag_list_
encoding_
protected java.lang.String encoding_
HTMLParserPolicy
public HTMLParserPolicy()
checkEndTagMatch
public boolean checkEndTagMatch()
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
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