|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnu.validator.htmlparser.impl.Tokenizer
public final class Tokenizer
An implementatition of
http://www.whatwg.org/specs/web-apps/current-work/multipage/section-tokenisation.html
This class implements the Locator
interface. This is not an
incidental implementation detail: Users of this class are encouraged to make
use of the Locator
nature.
By default, the tokenizer may report data that XML 1.0 bans. The tokenizer
can be configured to treat these conditions as fatal or to coerce the infoset
to something that XML 1.0 allows.
Constructor Summary | |
---|---|
Tokenizer(TokenHandler tokenHandler)
The constuctor. |
Method Summary | |
---|---|
void |
addCharacterHandler(CharacterHandler characterHandler)
|
int |
getColumnNumber()
|
XmlViolationPolicy |
getCommentPolicy()
Returns the commentPolicy. |
XmlViolationPolicy |
getContentNonXmlCharPolicy()
Returns the contentNonXmlCharPolicy. |
XmlViolationPolicy |
getContentSpacePolicy()
Returns the contentSpacePolicy. |
int |
getLineNumber()
|
java.lang.String |
getPublicId()
|
java.lang.String |
getSystemId()
|
boolean |
isAllowRewinding()
Returns the allowRewinding. |
boolean |
isCheckingNormalization()
Query if checking normalization. |
boolean |
isMappingLangToXmlLang()
Returns the mappingLangToXmlLang. |
void |
setAllowRewinding(boolean allowRewinding)
Sets the allowRewinding. |
void |
setBogusXmlnsPolicy(XmlViolationPolicy bogusXmlnsPolicy)
Sets the bogusXmlnsPolicy. |
void |
setCheckingNormalization(boolean enable)
Turns NFC checking on or off. |
void |
setCommentPolicy(XmlViolationPolicy commentPolicy)
Sets the commentPolicy. |
void |
setContentModelFlag(ContentModelFlag contentModelFlag,
java.lang.String contentModelElement)
Sets the content model flag and the associated element name. |
void |
setContentNonXmlCharPolicy(XmlViolationPolicy contentNonXmlCharPolicy)
Sets the contentNonXmlCharPolicy. |
void |
setContentSpacePolicy(XmlViolationPolicy contentSpacePolicy)
Sets the contentSpacePolicy. |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Sets the error handler. |
void |
setHeuristics(Heuristics heuristics)
Sets the encoding sniffing heuristics. |
void |
setHtml4ModeCompatibleWithXhtml1Schemata(boolean html4ModeCompatibleWithXhtml1Schemata)
Sets the html4ModeCompatibleWithXhtml1Schemata. |
void |
setMappingLangToXmlLang(boolean mappingLangToXmlLang)
Sets the mappingLangToXmlLang. |
void |
setNamePolicy(XmlViolationPolicy namePolicy)
|
void |
setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy)
Sets the xmlnsPolicy. |
void |
tokenize(org.xml.sax.InputSource is)
Runs the tokenization. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tokenizer(TokenHandler tokenHandler)
tokenHandler
- the handler for receiving tokensMethod Detail |
---|
public boolean isAllowRewinding()
public void setAllowRewinding(boolean allowRewinding)
allowRewinding
- the allowRewinding to setpublic void setCheckingNormalization(boolean enable)
enable
- true
if checking onpublic void addCharacterHandler(CharacterHandler characterHandler)
public boolean isCheckingNormalization()
true
if checking onpublic void setErrorHandler(org.xml.sax.ErrorHandler eh)
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)
public XmlViolationPolicy getCommentPolicy()
public void setCommentPolicy(XmlViolationPolicy commentPolicy)
commentPolicy
- the commentPolicy to setpublic XmlViolationPolicy getContentNonXmlCharPolicy()
public void setContentNonXmlCharPolicy(XmlViolationPolicy contentNonXmlCharPolicy)
contentNonXmlCharPolicy
- the contentNonXmlCharPolicy to setpublic XmlViolationPolicy getContentSpacePolicy()
public void setContentSpacePolicy(XmlViolationPolicy contentSpacePolicy)
contentSpacePolicy
- the contentSpacePolicy to setpublic void setXmlnsPolicy(XmlViolationPolicy xmlnsPolicy)
xmlnsPolicy
- the xmlnsPolicy to setpublic void setNamePolicy(XmlViolationPolicy namePolicy)
public void setBogusXmlnsPolicy(XmlViolationPolicy bogusXmlnsPolicy)
bogusXmlnsPolicy
- the bogusXmlnsPolicy to setpublic void setHtml4ModeCompatibleWithXhtml1Schemata(boolean html4ModeCompatibleWithXhtml1Schemata)
html4ModeCompatibleWithXhtml1Schemata
- the html4ModeCompatibleWithXhtml1Schemata to setpublic void tokenize(org.xml.sax.InputSource is) throws org.xml.sax.SAXException, java.io.IOException
is
- the input source
org.xml.sax.SAXException
- on fatal error (if configured to treat XML violations as
fatal) or if the token handler threw
java.io.IOException
- if the stream threwpublic void setContentModelFlag(ContentModelFlag contentModelFlag, java.lang.String contentModelElement)
contentModelFlag
- the flagcontentModelElement
- the element causing the flag to be setpublic java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
Locator.getPublicId()
public java.lang.String getSystemId()
getSystemId
in interface org.xml.sax.Locator
Locator.getSystemId()
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
Locator.getLineNumber()
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
Locator.getColumnNumber()
public boolean isMappingLangToXmlLang()
public void setMappingLangToXmlLang(boolean mappingLangToXmlLang)
mappingLangToXmlLang
- the mappingLangToXmlLang to setpublic void setHeuristics(Heuristics heuristics)
heuristics
- the heuristics to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |