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.ContentHandlercontentHandlerprivate static char[]ISINDEX_PROMPTprivate org.xml.sax.ext.LexicalHandlerlexicalHandler-
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 voidaddAttributesToElement(org.xml.sax.Attributes element, HtmlAttributes attributes)protected voidappendCharacters(org.xml.sax.Attributes parent, char[] buf, int start, int length)protected voidappendChildrenToNewParent(org.xml.sax.Attributes oldParent, org.xml.sax.Attributes newParent)protected voidappendComment(org.xml.sax.Attributes parent, char[] buf, int start, int length)protected voidappendCommentToDocument(char[] buf, int start, int length)protected voidappendDoctypeToDocument(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier)protected voidappendElement(org.xml.sax.Attributes child, org.xml.sax.Attributes newParent)protected voidappendIsindexPrompt(org.xml.sax.Attributes parent)protected org.xml.sax.AttributescreateElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes)protected org.xml.sax.AttributescreateHtmlElementSetAsRoot(HtmlAttributes attributes)protected voiddetachFromParent(org.xml.sax.Attributes element)protected voidelementPopped(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node)protected voidelementPushed(java.lang.String ns, java.lang.String name, org.xml.sax.Attributes node)protected voidend()protected voidfatal()Reports an condition that would make the infoset incompatible with XML 1.0 as fatal.protected booleanhasChildren(org.xml.sax.Attributes element)protected voidinsertFosterParentedCharacters(char[] buf, int start, int length, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent)protected voidinsertFosterParentedChild(org.xml.sax.Attributes child, org.xml.sax.Attributes table, org.xml.sax.Attributes stackParent)voidsetContentHandler(org.xml.sax.ContentHandler handler)voidsetLexicalHandler(org.xml.sax.ext.LexicalHandler handler)protected voidstart(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:
addAttributesToElementin 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:
appendCharactersin 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:
appendIsindexPromptin 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:
appendChildrenToNewParentin 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:
appendCommentin 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:
appendCommentToDocumentin 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:
createElementin 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:
createHtmlElementSetAsRootin 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:
detachFromParentin 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:
appendElementin 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:
hasChildrenin 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:
appendDoctypeToDocumentin 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:
elementPoppedin 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:
elementPushedin 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:
endin 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:
startin 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.SAXExceptionDescription copied from class:TreeBuilderReports an condition that would make the infoset incompatible with XML 1.0 as fatal.- Overrides:
fatalin classTreeBuilder<org.xml.sax.Attributes>- Throws:
org.xml.sax.SAXExceptionorg.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:
insertFosterParentedCharactersin 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:
insertFosterParentedChildin classTreeBuilder<org.xml.sax.Attributes>- Throws:
org.xml.sax.SAXException
-
-