public interface TokenHandler
Tokenizer reports tokens through this interface.| Modifier and Type | Method and Description |
|---|---|
boolean |
cdataSectionAllowed()
Checks if the CDATA sections are allowed.
|
void |
characters(char[] buf,
int start,
int length)
Receive character tokens.
|
void |
comment(char[] buf,
int start,
int length)
Receive a comment token.
|
void |
doctype(String name,
String publicIdentifier,
String systemIdentifier,
boolean forceQuirks)
Receive a doctype token.
|
void |
endTag(ElementName eltName)
Receive an end tag token.
|
void |
endTokenization()
The perform final cleanup.
|
void |
eof()
The end-of-file token.
|
void |
startTag(ElementName eltName,
HtmlAttributes attributes,
boolean selfClosing)
Receive a start tag token.
|
void |
startTokenization(Tokenizer self)
This method is called at the start of tokenization before any other
methods on this interface are called.
|
boolean |
wantsComments()
If this handler implementation cares about comments, return
true. |
void |
zeroOriginatingReplacementCharacter()
Reports a U+0000 that's being turned into a U+FFFD.
|
void startTokenization(Tokenizer self) throws SAXException
Tokenizer in order to set the content
model flag and in order to be able to query for Locator
data.self - the Tokenizer.SAXException - if something went wrongboolean wantsComments()
throws SAXException
true. If not, return false.SAXException - if something went wrongvoid doctype(String name, String publicIdentifier, String systemIdentifier, boolean forceQuirks) throws SAXException
name - the namepublicIdentifier - the public idsystemIdentifier - the system idforceQuirks - whether the token is correctSAXException - if something went wrongvoid startTag(ElementName eltName, HtmlAttributes attributes, boolean selfClosing) throws SAXException
eltName - the tag nameattributes - the attributesselfClosing - TODOSAXException - if something went wrongvoid endTag(ElementName eltName) throws SAXException
eltName - the tag nameSAXException - if something went wrongvoid comment(char[] buf,
int start,
int length)
throws SAXException
wantsComments() returned false.buf - a buffer holding the datastart - the offset into the bufferlength - the number of code units to readSAXException - if something went wrongvoid characters(char[] buf,
int start,
int length)
throws SAXException
buf - a buffer holding the datastart - offset into the bufferlength - the number of code units to readSAXException - if something went wrongContentHandler.characters(char[], int, int)void zeroOriginatingReplacementCharacter()
throws SAXException
SAXException - if something went wrongvoid eof() throws SAXException
SAXException - if something went wrongvoid endTokenization()
throws SAXException
SAXException - if something went wrongboolean cdataSectionAllowed()
throws SAXException
true if CDATA sections are allowedSAXException - if something went wrongCopyright © 2016. All rights reserved.