Package nu.validator.htmlparser.sax
Class SAXTreeBuilder
- All Implemented Interfaces:
TokenHandler
,TreeBuilderState<Element>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Node
private Node
private Document
private static final char[]
Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributesToElement
(Element element, HtmlAttributes attributes) protected void
appendCharacters
(Element parent, char[] buf, int start, int length) protected void
appendChildrenToNewParent
(Element oldParent, Element newParent) protected void
appendComment
(Element parent, char[] buf, int start, int length) protected void
appendCommentToDocument
(char[] buf, int start, int length) protected void
appendDoctypeToDocument
(String name, String publicIdentifier, String systemIdentifier) protected void
appendElement
(Element child, Element newParent) protected void
appendIsindexPrompt
(Element parent) protected Element
createElement
(String ns, String name, HtmlAttributes attributes) protected Element
createHtmlElementSetAsRoot
(HtmlAttributes attributes) protected void
detachFromParent
(Element element) protected void
end()
(package private) Document
Returns the document.(package private) DocumentFragment
protected boolean
hasChildren
(Element element) protected void
insertFosterParentedCharacters
(char[] buf, int start, int length, Element table, Element stackParent) protected void
insertFosterParentedChild
(Element child, Element table, Element stackParent) private Node
previousSibling
(Node table) protected void
start
(boolean fragment) Methods inherited from class nu.validator.htmlparser.impl.TreeBuilder
accumulateCharacters, cdataSectionAllowed, characters, comment, createElement, currentNode, doctype, documentMode, 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
-
ISINDEX_PROMPT
private static final char[] ISINDEX_PROMPT -
document
-
cachedTable
-
cachedTablePreviousSibling
-
-
Constructor Details
-
SAXTreeBuilder
SAXTreeBuilder()
-
-
Method Details
-
appendComment
- Specified by:
appendComment
in classTreeBuilder<Element>
-
appendCommentToDocument
protected void appendCommentToDocument(char[] buf, int start, int length) - Specified by:
appendCommentToDocument
in classTreeBuilder<Element>
-
appendCharacters
- Specified by:
appendCharacters
in classTreeBuilder<Element>
-
appendIsindexPrompt
- Specified by:
appendIsindexPrompt
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
hasChildren
- Specified by:
hasChildren
in classTreeBuilder<Element>
-
appendElement
- Specified by:
appendElement
in classTreeBuilder<Element>
-
createHtmlElementSetAsRoot
- Specified by:
createHtmlElementSetAsRoot
in classTreeBuilder<Element>
-
addAttributesToElement
protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException - Specified by:
addAttributesToElement
in classTreeBuilder<Element>
- Throws:
SAXException
-
appendDoctypeToDocument
protected void appendDoctypeToDocument(String name, String publicIdentifier, String systemIdentifier) - Overrides:
appendDoctypeToDocument
in classTreeBuilder<Element>
- See Also:
-
getDocument
Document getDocument()Returns the document.- Returns:
- the document
-
getDocumentFragment
DocumentFragment getDocumentFragment() -
end
- Overrides:
end
in classTreeBuilder<Element>
- Throws:
SAXException
- See Also:
-
start
protected void start(boolean fragment) - Overrides:
start
in classTreeBuilder<Element>
- See Also:
-
appendChildrenToNewParent
- Specified by:
appendChildrenToNewParent
in classTreeBuilder<Element>
- Throws:
SAXException
-
createElement
protected Element createElement(String ns, String name, HtmlAttributes attributes) throws SAXException - Specified by:
createElement
in classTreeBuilder<Element>
- Throws:
SAXException
-
insertFosterParentedCharacters
protected void insertFosterParentedCharacters(char[] buf, int start, int length, Element table, Element stackParent) throws SAXException - Specified by:
insertFosterParentedCharacters
in classTreeBuilder<Element>
- Throws:
SAXException
-
insertFosterParentedChild
protected void insertFosterParentedChild(Element child, Element table, Element stackParent) throws SAXException - Specified by:
insertFosterParentedChild
in classTreeBuilder<Element>
- Throws:
SAXException
-
previousSibling
-
detachFromParent
- Specified by:
detachFromParent
in classTreeBuilder<Element>
- Throws:
SAXException
-