Package nu.validator.htmlparser.dom
Class DOMTreeBuilder
java.lang.Object
nu.validator.htmlparser.impl.TreeBuilder<Element>
nu.validator.htmlparser.impl.CoalescingTreeBuilder<Element>
nu.validator.htmlparser.dom.DOMTreeBuilder
- All Implemented Interfaces:
TokenHandler
,TreeBuilderState<Element>
The tree builder glue for building a tree through the public DOM APIs.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Document
The current doc.private DOMImplementation
The DOM impl.Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DOMTreeBuilder
(DOMImplementation implementation) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributesToElement
(Element element, HtmlAttributes attributes) protected void
appendCharacters
(Element parent, String text) protected void
appendChildrenToNewParent
(Element oldParent, Element newParent) protected void
appendComment
(Element parent, String comment) protected void
appendCommentToDocument
(String comment) protected void
appendElement
(Element child, Element newParent) protected Element
createElement
(String ns, String name, HtmlAttributes attributes) protected Element
createElement
(String ns, String name, HtmlAttributes attributes, Element form) protected Element
createHtmlElementSetAsRoot
(HtmlAttributes attributes) protected void
detachFromParent
(Element element) protected void
documentMode
(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) (package private) Document
Returns the document.(package private) DocumentFragment
Return the document fragment.protected boolean
hasChildren
(Element element) protected void
insertFosterParentedCharacters
(String text, Element table, Element stackParent) protected void
insertFosterParentedChild
(Element child, Element table, 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, end, 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
-
implementation
The DOM impl. -
document
The current doc.
-
-
Constructor Details
-
DOMTreeBuilder
The constructor.- Parameters:
implementation
- the DOM impl.
-
-
Method Details
-
addAttributesToElement
protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException - Specified by:
addAttributesToElement
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
appendCharacters
- Specified by:
appendCharacters
in classCoalescingTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
appendChildrenToNewParent
- Specified by:
appendChildrenToNewParent
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
appendComment
- Specified by:
appendComment
in classCoalescingTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
appendCommentToDocument
- Specified by:
appendCommentToDocument
in classCoalescingTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
createElement
protected Element createElement(String ns, String name, HtmlAttributes attributes) throws SAXException - Specified by:
createElement
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
createHtmlElementSetAsRoot
- Specified by:
createHtmlElementSetAsRoot
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
appendElement
- Specified by:
appendElement
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
hasChildren
- Specified by:
hasChildren
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
createElement
protected Element createElement(String ns, String name, HtmlAttributes attributes, Element form) throws SAXException - Overrides:
createElement
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
start
- Overrides:
start
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
documentMode
protected void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws SAXException - Overrides:
documentMode
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
getDocument
Document getDocument()Returns the document.- Returns:
- the document
-
getDocumentFragment
DocumentFragment getDocumentFragment()Return the document fragment.- Returns:
- the document fragment
-
insertFosterParentedCharacters
protected void insertFosterParentedCharacters(String text, Element table, Element stackParent) throws SAXException - Specified by:
insertFosterParentedCharacters
in classCoalescingTreeBuilder<Element>
- Throws:
SAXException
-
insertFosterParentedChild
protected void insertFosterParentedChild(Element child, Element table, Element stackParent) throws SAXException - Specified by:
insertFosterParentedChild
in classTreeBuilder<Element>
- Throws:
SAXException
-
detachFromParent
- Specified by:
detachFromParent
in classTreeBuilder<Element>
- Throws:
SAXException
-