Package nu.validator.htmlparser.sax
Class SAXStreamer
- java.lang.Object
-
- nu.validator.htmlparser.impl.TreeBuilder<org.xml.sax.Attributes>
-
- nu.validator.htmlparser.sax.SAXStreamer
-
- All Implemented Interfaces:
TokenHandler
,TreeBuilderState<org.xml.sax.Attributes>
class SAXStreamer extends TreeBuilder<org.xml.sax.Attributes>
-
-
Field Summary
Fields Modifier and Type Field Description private org.xml.sax.ContentHandler
contentHandler
private static char[]
ISINDEX_PROMPT
private org.xml.sax.ext.LexicalHandler
lexicalHandler
-
Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer
-
-
Constructor Summary
Constructors Constructor Description SAXStreamer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAttributesToElement(org.xml.sax.Attributes element, HtmlAttributes attributes)
protected void
appendCharacters(org.xml.sax.Attributes parent, char[] buf, int start, int length)
protected void
appendChildrenToNewParent(org.xml.sax.Attributes oldParent, org.xml.sax.Attributes newParent)
protected void
appendComment(org.xml.sax.Attributes parent, char[] buf, int start, int length)
protected 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
appendElement(org.xml.sax.Attributes child, org.xml.sax.Attributes newParent)
protected void
appendIsindexPrompt(org.xml.sax.Attributes parent)
protected org.xml.sax.Attributes
createElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes)
protected org.xml.sax.Attributes
createHtmlElementSetAsRoot(HtmlAttributes attributes)
protected void
detachFromParent(org.xml.sax.Attributes element)
protected void
elementPopped(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node)
protected void
elementPushed(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node)
protected void
end()
protected void
fatal()
Reports an condition that would make the infoset incompatible with XML 1.0 as fatal.protected boolean
hasChildren(org.xml.sax.Attributes element)
protected void
insertFosterParentedCharacters(char[] buf, int start, int length, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent)
protected void
insertFosterParentedChild(org.xml.sax.Attributes child, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent)
void
setContentHandler(org.xml.sax.ContentHandler handler)
void
setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
protected void
start(boolean fragment)
-
Methods inherited from class nu.validator.htmlparser.impl.TreeBuilder
accumulateCharacters, cdataSectionAllowed, characters, comment, createElement, currentNode, doctype, documentMode, endTag, endTokenization, eof, extractCharsetFromContent, 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
-
-
-
-
Method Detail
-
addAttributesToElement
protected void addAttributesToElement(org.xml.sax.Attributes element, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Specified by:
addAttributesToElement
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
appendCharacters
protected void appendCharacters(org.xml.sax.Attributes parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
- Specified by:
appendCharacters
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
appendIsindexPrompt
protected void appendIsindexPrompt(org.xml.sax.Attributes parent) throws org.xml.sax.SAXException
- Specified by:
appendIsindexPrompt
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
TreeBuilder.appendIsindexPrompt(java.lang.Object)
-
appendChildrenToNewParent
protected void appendChildrenToNewParent(org.xml.sax.Attributes oldParent, org.xml.sax.Attributes newParent) throws org.xml.sax.SAXException
- Specified by:
appendChildrenToNewParent
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
appendComment
protected void appendComment(org.xml.sax.Attributes parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
- Specified by:
appendComment
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
appendCommentToDocument
protected void appendCommentToDocument(char[] buf, int start, int length) throws org.xml.sax.SAXException
- Specified by:
appendCommentToDocument
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
createElement
protected org.xml.sax.Attributes createElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Specified by:
createElement
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
createHtmlElementSetAsRoot
protected org.xml.sax.Attributes createHtmlElementSetAsRoot(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Specified by:
createHtmlElementSetAsRoot
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
detachFromParent
protected void detachFromParent(org.xml.sax.Attributes element) throws org.xml.sax.SAXException
- Specified by:
detachFromParent
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
appendElement
protected void appendElement(org.xml.sax.Attributes child, org.xml.sax.Attributes newParent) throws org.xml.sax.SAXException
- Specified by:
appendElement
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
hasChildren
protected boolean hasChildren(org.xml.sax.Attributes element) throws org.xml.sax.SAXException
- Specified by:
hasChildren
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
setContentHandler
public void setContentHandler(org.xml.sax.ContentHandler handler)
-
setLexicalHandler
public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
-
appendDoctypeToDocument
protected void appendDoctypeToDocument(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier) throws org.xml.sax.SAXException
- Overrides:
appendDoctypeToDocument
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
TreeBuilder.appendDoctypeToDocument(java.lang.String, java.lang.String, java.lang.String)
-
elementPopped
protected void elementPopped(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node) throws org.xml.sax.SAXException
- Overrides:
elementPopped
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
TreeBuilder.elementPopped(String, java.lang.String, java.lang.Object)
-
elementPushed
protected void elementPushed(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node) throws org.xml.sax.SAXException
- Overrides:
elementPushed
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
TreeBuilder.elementPushed(String, java.lang.String, java.lang.Object)
-
end
protected void end() throws org.xml.sax.SAXException
- Overrides:
end
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
TreeBuilder.end()
-
start
protected void start(boolean fragment) throws org.xml.sax.SAXException
- Overrides:
start
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
- See Also:
nu.validator.htmlparser.impl.TreeBuilder#start()
-
fatal
protected void fatal() throws org.xml.sax.SAXException
Description copied from class:TreeBuilder
Reports an condition that would make the infoset incompatible with XML 1.0 as fatal.- Overrides:
fatal
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
org.xml.sax.SAXParseException
-
insertFosterParentedCharacters
protected void insertFosterParentedCharacters(char[] buf, int start, int length, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent) throws org.xml.sax.SAXException
- Specified by:
insertFosterParentedCharacters
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
insertFosterParentedChild
protected void insertFosterParentedChild(org.xml.sax.Attributes child, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent) throws org.xml.sax.SAXException
- Specified by:
insertFosterParentedChild
in classTreeBuilder<org.xml.sax.Attributes>
- Throws:
org.xml.sax.SAXException
-
-