nu.validator.htmlparser.sax
Class SAXStreamer

java.lang.Object
  extended by nu.validator.htmlparser.impl.TreeBuilder<Attributes>
      extended by nu.validator.htmlparser.sax.SAXStreamer
All Implemented Interfaces:
TokenHandler

 class SAXStreamer
extends TreeBuilder<Attributes>


Field Summary
private  ContentHandler contentHandler
           
private  int depth
           
private  LexicalHandler lexicalHandler
           
 
Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
tokenizer
 
Constructor Summary
SAXStreamer()
           
 
Method Summary
protected  void addAttributesToElement(Attributes element, Attributes attributes)
           
protected  void appendCharacters(Attributes parent, char[] buf, int start, int length)
           
protected  void appendChildrenToNewParent(Attributes oldParent, Attributes newParent)
           
protected  void appendComment(Attributes 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 bodyClosed(Attributes body)
           
protected  Attributes createElement(String name, Attributes attributes)
           
protected  Attributes createHtmlElementSetAsRoot(Attributes attributes)
           
protected  void detachFromParent(Attributes element)
           
protected  void detachFromParentAndAppendToNewParent(Attributes child, Attributes newParent)
           
protected  void elementPopped(String name, Attributes node)
           
protected  void elementPushed(String name, Attributes node)
           
protected  void end()
           
protected  boolean hasChildren(Attributes element)
           
protected  void htmlClosed(Attributes html)
           
protected  void insertBefore(Attributes child, Attributes sibling, Attributes parent)
           
protected  void insertCharactersBefore(char[] buf, int start, int length, Attributes sibling, Attributes parent)
           
protected  Attributes parentElementFor(Attributes child)
          Get the parent element.
 void setContentHandler(ContentHandler handler)
           
 void setLexicalHandler(LexicalHandler handler)
           
protected  Attributes shallowClone(Attributes element)
           
protected  void start(boolean fragment)
           
 
Methods inherited from class nu.validator.htmlparser.impl.TreeBuilder
characters, comment, createElement, currentNode, doctype, documentMode, endTag, eof, err, fatal, fatal, isScriptingEnabled, setDoctypeExpectation, setDocumentModeHandler, setErrorHandler, setFragmentContext, setIgnoringComments, setReportingDoctype, setScriptingEnabled, start, startTag, wantsComments, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentHandler

private ContentHandler contentHandler

lexicalHandler

private LexicalHandler lexicalHandler

depth

private int depth
Constructor Detail

SAXStreamer

SAXStreamer()
Method Detail

addAttributesToElement

protected void addAttributesToElement(Attributes element,
                                      Attributes attributes)
                               throws SAXException
Specified by:
addAttributesToElement in class TreeBuilder<Attributes>
Throws:
SAXException

appendCharacters

protected void appendCharacters(Attributes parent,
                                char[] buf,
                                int start,
                                int length)
                         throws SAXException
Specified by:
appendCharacters in class TreeBuilder<Attributes>
Throws:
SAXException

appendChildrenToNewParent

protected void appendChildrenToNewParent(Attributes oldParent,
                                         Attributes newParent)
                                  throws SAXException
Specified by:
appendChildrenToNewParent in class TreeBuilder<Attributes>
Throws:
SAXException

appendComment

protected void appendComment(Attributes parent,
                             char[] buf,
                             int start,
                             int length)
                      throws SAXException
Specified by:
appendComment in class TreeBuilder<Attributes>
Throws:
SAXException

appendCommentToDocument

protected void appendCommentToDocument(char[] buf,
                                       int start,
                                       int length)
                                throws SAXException
Specified by:
appendCommentToDocument in class TreeBuilder<Attributes>
Throws:
SAXException

createElement

protected Attributes createElement(String name,
                                   Attributes attributes)
                            throws SAXException
Specified by:
createElement in class TreeBuilder<Attributes>
Throws:
SAXException

createHtmlElementSetAsRoot

protected Attributes createHtmlElementSetAsRoot(Attributes attributes)
                                         throws SAXException
Specified by:
createHtmlElementSetAsRoot in class TreeBuilder<Attributes>
Throws:
SAXException

detachFromParent

protected void detachFromParent(Attributes element)
                         throws SAXException
Specified by:
detachFromParent in class TreeBuilder<Attributes>
Throws:
SAXException

detachFromParentAndAppendToNewParent

protected void detachFromParentAndAppendToNewParent(Attributes child,
                                                    Attributes newParent)
                                             throws SAXException
Specified by:
detachFromParentAndAppendToNewParent in class TreeBuilder<Attributes>
Throws:
SAXException

hasChildren

protected boolean hasChildren(Attributes element)
                       throws SAXException
Specified by:
hasChildren in class TreeBuilder<Attributes>
Throws:
SAXException

insertBefore

protected void insertBefore(Attributes child,
                            Attributes sibling,
                            Attributes parent)
                     throws SAXException
Specified by:
insertBefore in class TreeBuilder<Attributes>
Throws:
SAXException

insertCharactersBefore

protected void insertCharactersBefore(char[] buf,
                                      int start,
                                      int length,
                                      Attributes sibling,
                                      Attributes parent)
                               throws SAXException
Specified by:
insertCharactersBefore in class TreeBuilder<Attributes>
Throws:
SAXException

parentElementFor

protected Attributes parentElementFor(Attributes child)
                               throws SAXException
Description copied from class: TreeBuilder
Get the parent element. MUST return null if there is no parent or the parent is not an element.

Specified by:
parentElementFor in class TreeBuilder<Attributes>
Throws:
SAXException

shallowClone

protected Attributes shallowClone(Attributes element)
                           throws SAXException
Specified by:
shallowClone in class TreeBuilder<Attributes>
Throws:
SAXException

setContentHandler

public void setContentHandler(ContentHandler handler)

setLexicalHandler

public void setLexicalHandler(LexicalHandler handler)

appendDoctypeToDocument

protected void appendDoctypeToDocument(String name,
                                       String publicIdentifier,
                                       String systemIdentifier)
                                throws SAXException
Overrides:
appendDoctypeToDocument in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.appendDoctypeToDocument(java.lang.String, java.lang.String, java.lang.String)

bodyClosed

protected void bodyClosed(Attributes body)
                   throws SAXException
Overrides:
bodyClosed in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.bodyClosed(java.lang.Object)

elementPopped

protected void elementPopped(String name,
                             Attributes node)
                      throws SAXException
Overrides:
elementPopped in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.elementPopped(java.lang.String, java.lang.Object)

elementPushed

protected void elementPushed(String name,
                             Attributes node)
                      throws SAXException
Overrides:
elementPushed in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.elementPushed(java.lang.String, java.lang.Object)

end

protected void end()
            throws SAXException
Overrides:
end in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.end()

htmlClosed

protected void htmlClosed(Attributes html)
                   throws SAXException
Overrides:
htmlClosed in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
TreeBuilder.htmlClosed(java.lang.Object)

start

protected void start(boolean fragment)
              throws SAXException
Overrides:
start in class TreeBuilder<Attributes>
Throws:
SAXException
See Also:
nu.validator.htmlparser.impl.TreeBuilder#start()