|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnu.validator.htmlparser.impl.TreeBuilder<T>
public abstract class TreeBuilder<T>
Field Summary | |
---|---|
protected Tokenizer |
tokenizer
|
Constructor Summary | |
---|---|
protected |
TreeBuilder(XmlViolationPolicy streamabilityViolationPolicy,
boolean coalescingText)
|
Method Summary | |
---|---|
protected abstract void |
addAttributesToElement(T element,
org.xml.sax.Attributes attributes)
|
protected abstract void |
appendCharacters(T parent,
char[] buf,
int start,
int length)
|
protected abstract void |
appendChildrenToNewParent(T oldParent,
T newParent)
|
protected abstract void |
appendComment(T parent,
char[] buf,
int start,
int length)
|
protected abstract void |
appendCommentToDocument(char[] buf,
int start,
int length)
|
protected void |
appendDoctypeToDocument(java.lang.String name,
java.lang.String publicIdentifier,
java.lang.String systemIdentifier)
|
protected void |
bodyClosed(T body)
|
void |
characters(char[] buf,
int start,
int length)
Receive character tokens. |
void |
comment(char[] buf,
int length)
Receive a comment token. |
protected abstract T |
createElement(java.lang.String name,
org.xml.sax.Attributes attributes)
|
protected T |
createElement(java.lang.String name,
org.xml.sax.Attributes attributes,
T form)
|
protected abstract T |
createHtmlElementSetAsRoot(org.xml.sax.Attributes attributes)
|
protected T |
currentNode()
|
protected abstract void |
detachFromParent(T element)
|
protected abstract void |
detachFromParentAndAppendToNewParent(T child,
T newParent)
|
void |
doctype(java.lang.String name,
java.lang.String publicIdentifier,
java.lang.String systemIdentifier,
boolean forceQuirks)
Receive a doctype token. |
protected void |
documentMode(DocumentMode mode,
java.lang.String publicIdentifier,
java.lang.String systemIdentifier,
boolean html4SpecificAdditionalErrorChecks)
|
protected void |
elementPopped(java.lang.String name,
T node)
|
protected void |
elementPushed(java.lang.String name,
T node)
|
protected void |
end()
|
void |
endTag(java.lang.String name,
org.xml.sax.Attributes attributes)
Receive an end tag token. |
void |
eof()
The end-of-file token. |
protected void |
err(java.lang.String message)
Reports a Parse Error. |
protected void |
fatal()
Reports an condition that would make the infoset incompatible with XML 1.0 as fatal. |
protected void |
fatal(java.lang.Exception e)
|
protected abstract boolean |
hasChildren(T element)
|
protected void |
htmlClosed(T html)
|
protected abstract void |
insertBefore(T child,
T sibling,
T parent)
|
protected abstract void |
insertCharactersBefore(char[] buf,
int start,
int length,
T sibling,
T parent)
|
boolean |
isScriptingEnabled()
Returns the scriptingEnabled. |
protected abstract T |
parentElementFor(T child)
Get the parent element. |
void |
setDoctypeExpectation(DoctypeExpectation doctypeExpectation)
Sets the doctypeExpectation. |
void |
setDocumentModeHandler(DocumentModeHandler documentModeHandler)
Sets the documentModeHandler. |
void |
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets the errorHandler. |
void |
setFragmentContext(java.lang.String context)
|
void |
setIgnoringComments(boolean ignoreComments)
|
void |
setReportingDoctype(boolean reportingDoctype)
Sets the reportingDoctype. |
void |
setScriptingEnabled(boolean scriptingEnabled)
Sets the scriptingEnabled. |
protected abstract T |
shallowClone(T element)
|
protected void |
start(boolean fragment)
|
void |
start(Tokenizer self)
This method is called at the start of tokenization before any other methods on this interface are called. |
void |
startTag(java.lang.String name,
org.xml.sax.Attributes attributes)
Receive a start tag token. |
boolean |
wantsComments()
If this handler implementation cares about comments, return true . |
protected void |
warn(java.lang.String message)
Reports a warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Tokenizer tokenizer
Constructor Detail |
---|
protected TreeBuilder(XmlViolationPolicy streamabilityViolationPolicy, boolean coalescingText)
Method Detail |
---|
protected final void fatal() throws org.xml.sax.SAXException
org.xml.sax.SAXException
org.xml.sax.SAXParseException
protected final void fatal(java.lang.Exception e) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected final void err(java.lang.String message) throws org.xml.sax.SAXException
message
- the message
org.xml.sax.SAXException
protected final void warn(java.lang.String message) throws org.xml.sax.SAXException
message
- the message
org.xml.sax.SAXException
public final void start(Tokenizer self) throws org.xml.sax.SAXException
TokenHandler
Tokenizer
in order to set the
content model flag and in order to be able to query for
Locator
data.
start
in interface TokenHandler
self
- the Tokenizer
.
org.xml.sax.SAXException
- if something went wrongpublic final void doctype(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean forceQuirks) throws org.xml.sax.SAXException
TokenHandler
doctype
in interface TokenHandler
name
- the namepublicIdentifier
- the public idsystemIdentifier
- the system idforceQuirks
- whether the token is correct
org.xml.sax.SAXException
- if something went wrongpublic final void comment(char[] buf, int length) throws org.xml.sax.SAXException
TokenHandler
wantsComments()
returned false
.
comment
in interface TokenHandler
buf
- a buffer holding the datalength
- the number of code units to read
org.xml.sax.SAXException
- if something went wrongpublic final void characters(char[] buf, int start, int length) throws org.xml.sax.SAXException
TokenHandler
characters
in interface TokenHandler
buf
- a buffer holding the datastart
- offset into the bufferlength
- the number of code units to read
org.xml.sax.SAXException
- if something went wrongTokenHandler.characters(char[], int, int)
public final void eof() throws org.xml.sax.SAXException
TokenHandler
eof
in interface TokenHandler
org.xml.sax.SAXException
- if something went wrongpublic final void startTag(java.lang.String name, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
TokenHandler
startTag
in interface TokenHandler
name
- the tag nameattributes
- the attributes
org.xml.sax.SAXException
- if something went wrongpublic final void endTag(java.lang.String name, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
TokenHandler
endTag
in interface TokenHandler
name
- the tag nameattributes
- the attributes
org.xml.sax.SAXException
- if something went wrongprotected abstract T createElement(java.lang.String name, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected T createElement(java.lang.String name, org.xml.sax.Attributes attributes, T form) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract T createHtmlElementSetAsRoot(org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void detachFromParent(T element) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract boolean hasChildren(T element) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract T shallowClone(T element) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void detachFromParentAndAppendToNewParent(T child, T newParent) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void appendChildrenToNewParent(T oldParent, T newParent) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract T parentElementFor(T child) throws org.xml.sax.SAXException
null
if there is no parent
or the parent is not an element.
org.xml.sax.SAXException
protected abstract void insertBefore(T child, T sibling, T parent) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void insertCharactersBefore(char[] buf, int start, int length, T sibling, T parent) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void appendCharacters(T parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void appendComment(T parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void appendCommentToDocument(char[] buf, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void addAttributesToElement(T element, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void start(boolean fragment) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void end() throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void bodyClosed(T body) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void htmlClosed(T html) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void appendDoctypeToDocument(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void elementPushed(java.lang.String name, T node) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void elementPopped(java.lang.String name, T node) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void documentMode(DocumentMode mode, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public boolean wantsComments()
TokenHandler
true
.
If not, return false
.
wantsComments
in interface TokenHandler
TokenHandler.wantsComments()
public void setIgnoringComments(boolean ignoreComments)
public final void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
errorHandler
- the errorHandler to setpublic final void setFragmentContext(java.lang.String context)
protected final T currentNode()
public boolean isScriptingEnabled()
public void setScriptingEnabled(boolean scriptingEnabled)
scriptingEnabled
- the scriptingEnabled to setpublic void setDoctypeExpectation(DoctypeExpectation doctypeExpectation)
doctypeExpectation
- the doctypeExpectation to setpublic void setDocumentModeHandler(DocumentModeHandler documentModeHandler)
documentModeHandler
- the documentModeHandler to setpublic void setReportingDoctype(boolean reportingDoctype)
reportingDoctype
- the reportingDoctype to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |