Package nu.validator.htmlparser.xom
Class XOMTreeBuilder
java.lang.Object
nu.validator.htmlparser.impl.TreeBuilder<nu.xom.Element>
nu.validator.htmlparser.impl.CoalescingTreeBuilder<nu.xom.Element>
nu.validator.htmlparser.xom.XOMTreeBuilder
- All Implemented Interfaces:
TokenHandler
,TreeBuilderState<nu.xom.Element>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate nu.xom.Element
private int
private nu.xom.Document
private final SimpleNodeFactory
Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributesToElement
(nu.xom.Element element, HtmlAttributes attributes) protected void
appendCharacters
(nu.xom.Element parent, String text) protected void
appendChildrenToNewParent
(nu.xom.Element oldParent, nu.xom.Element newParent) protected void
appendComment
(nu.xom.Element parent, String comment) protected void
appendCommentToDocument
(String comment) protected void
appendElement
(nu.xom.Element child, nu.xom.Element newParent) protected nu.xom.Element
createElement
(String ns, String name, HtmlAttributes attributes) protected nu.xom.Element
createElement
(String ns, String name, HtmlAttributes attributes, nu.xom.Element form) protected nu.xom.Element
createHtmlElementSetAsRoot
(HtmlAttributes attributes) protected void
detachFromParent
(nu.xom.Element element) protected void
documentMode
(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) protected void
end()
(package private) nu.xom.Document
Returns the document.(package private) nu.xom.Nodes
protected boolean
hasChildren
(nu.xom.Element element) private int
indexOfTable
(nu.xom.Element table, nu.xom.Element stackParent) protected void
insertFosterParentedCharacters
(String text, nu.xom.Element table, nu.xom.Element stackParent) protected void
insertFosterParentedChild
(nu.xom.Element child, nu.xom.Element table, nu.xom.Element stackParent) protected void
start
(boolean fragment) Methods inherited from class nu.validator.htmlparser.impl.CoalescingTreeBuilder
accumulateCharacters, appendCharacters, appendComment, appendCommentToDocument, appendIsindexPrompt, insertFosterParentedCharacters
Methods inherited from class nu.validator.htmlparser.impl.TreeBuilder
appendDoctypeToDocument, cdataSectionAllowed, characters, comment, currentNode, doctype, elementPopped, elementPushed, endTag, endTokenization, eof, extractCharsetFromContent, fatal, fatal, flushCharacters, getDeepTreeSurrogateParent, getErrorHandler, getFormPointer, getHeadPointer, getListOfActiveFormattingElements, getListOfActiveFormattingElementsLength, getMode, getOriginalMode, getStack, getStackLength, isFramesetOk, isNeedToDropLF, isQuirks, isScriptingEnabled, loadState, markMalformedIfScript, newSnapshot, requestSuspension, setDoctypeExpectation, setDocumentModeHandler, setErrorHandler, setFragmentContext, setFragmentContext, setIgnoringComments, setNamePolicy, setReportingDoctype, setScriptingEnabled, snapshotMatches, startTag, startTokenization, wantsComments, zeroOriginatingReplacementCharacter
-
Field Details
-
nodeFactory
-
document
private nu.xom.Document document -
cachedTableIndex
private int cachedTableIndex -
cachedTable
private nu.xom.Element cachedTable
-
-
Constructor Details
-
XOMTreeBuilder
-
-
Method Details
-
addAttributesToElement
protected void addAttributesToElement(nu.xom.Element element, HtmlAttributes attributes) throws SAXException - Specified by:
addAttributesToElement
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
appendCharacters
- Specified by:
appendCharacters
in classCoalescingTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
appendChildrenToNewParent
protected void appendChildrenToNewParent(nu.xom.Element oldParent, nu.xom.Element newParent) throws SAXException - Specified by:
appendChildrenToNewParent
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
appendComment
- Specified by:
appendComment
in classCoalescingTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
appendCommentToDocument
- Specified by:
appendCommentToDocument
in classCoalescingTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
createElement
protected nu.xom.Element createElement(String ns, String name, HtmlAttributes attributes) throws SAXException - Specified by:
createElement
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
createHtmlElementSetAsRoot
- Specified by:
createHtmlElementSetAsRoot
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
detachFromParent
- Specified by:
detachFromParent
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
appendElement
- Specified by:
appendElement
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
hasChildren
- Specified by:
hasChildren
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
getDocument
nu.xom.Document getDocument()Returns the document.- Returns:
- the document
-
getDocumentFragment
nu.xom.Nodes getDocumentFragment() -
createElement
protected nu.xom.Element createElement(String ns, String name, HtmlAttributes attributes, nu.xom.Element form) throws SAXException - Overrides:
createElement
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
- See Also:
-
start
- Overrides:
start
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
- See Also:
-
documentMode
protected void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws SAXException - Overrides:
documentMode
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
- See Also:
-
insertFosterParentedCharacters
protected void insertFosterParentedCharacters(String text, nu.xom.Element table, nu.xom.Element stackParent) throws SAXException - Specified by:
insertFosterParentedCharacters
in classCoalescingTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
insertFosterParentedChild
protected void insertFosterParentedChild(nu.xom.Element child, nu.xom.Element table, nu.xom.Element stackParent) throws SAXException - Specified by:
insertFosterParentedChild
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
-
indexOfTable
private int indexOfTable(nu.xom.Element table, nu.xom.Element stackParent) -
end
- Overrides:
end
in classTreeBuilder<nu.xom.Element>
- Throws:
SAXException
- See Also:
-