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.Elementprivate intprivate nu.xom.Documentprivate final SimpleNodeFactoryFields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttributesToElement(nu.xom.Element element, HtmlAttributes attributes) protected voidappendCharacters(nu.xom.Element parent, String text) protected voidappendChildrenToNewParent(nu.xom.Element oldParent, nu.xom.Element newParent) protected voidappendComment(nu.xom.Element parent, String comment) protected voidappendCommentToDocument(String comment) protected voidappendElement(nu.xom.Element child, nu.xom.Element newParent) protected nu.xom.ElementcreateElement(String ns, String name, HtmlAttributes attributes) protected nu.xom.ElementcreateElement(String ns, String name, HtmlAttributes attributes, nu.xom.Element form) protected nu.xom.ElementcreateHtmlElementSetAsRoot(HtmlAttributes attributes) protected voiddetachFromParent(nu.xom.Element element) protected voiddocumentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) protected voidend()(package private) nu.xom.DocumentReturns the document.(package private) nu.xom.Nodesprotected booleanhasChildren(nu.xom.Element element) private intindexOfTable(nu.xom.Element table, nu.xom.Element stackParent) protected voidinsertFosterParentedCharacters(String text, nu.xom.Element table, nu.xom.Element stackParent) protected voidinsertFosterParentedChild(nu.xom.Element child, nu.xom.Element table, nu.xom.Element stackParent) protected voidstart(boolean fragment) Methods inherited from class nu.validator.htmlparser.impl.CoalescingTreeBuilder
accumulateCharacters, appendCharacters, appendComment, appendCommentToDocument, appendIsindexPrompt, insertFosterParentedCharactersMethods 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:
addAttributesToElementin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
appendCharacters
- Specified by:
appendCharactersin classCoalescingTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
appendChildrenToNewParent
protected void appendChildrenToNewParent(nu.xom.Element oldParent, nu.xom.Element newParent) throws SAXException - Specified by:
appendChildrenToNewParentin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
appendComment
- Specified by:
appendCommentin classCoalescingTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
appendCommentToDocument
- Specified by:
appendCommentToDocumentin classCoalescingTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
createElement
protected nu.xom.Element createElement(String ns, String name, HtmlAttributes attributes) throws SAXException - Specified by:
createElementin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
createHtmlElementSetAsRoot
- Specified by:
createHtmlElementSetAsRootin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
detachFromParent
- Specified by:
detachFromParentin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
appendElement
- Specified by:
appendElementin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
hasChildren
- Specified by:
hasChildrenin 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:
createElementin classTreeBuilder<nu.xom.Element>- Throws:
SAXException- See Also:
-
start
- Overrides:
startin classTreeBuilder<nu.xom.Element>- Throws:
SAXException- See Also:
-
documentMode
protected void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws SAXException - Overrides:
documentModein 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:
insertFosterParentedCharactersin 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:
insertFosterParentedChildin classTreeBuilder<nu.xom.Element>- Throws:
SAXException
-
indexOfTable
private int indexOfTable(nu.xom.Element table, nu.xom.Element stackParent) -
end
- Overrides:
endin classTreeBuilder<nu.xom.Element>- Throws:
SAXException- See Also:
-