nu.validator.htmlparser.impl
Class CoalescingTreeBuilder<T>

java.lang.Object
  extended by nu.validator.htmlparser.impl.TreeBuilder<T>
      extended by nu.validator.htmlparser.impl.CoalescingTreeBuilder<T>
All Implemented Interfaces:
TokenHandler, TreeBuilderState<T>

public abstract class CoalescingTreeBuilder<T>
extends TreeBuilder<T>

A common superclass for tree builders that coalesce their text nodes.

Version:
$Id$
Author:
hsivonen

Field Summary
 
Fields inherited from class nu.validator.htmlparser.impl.TreeBuilder
charBuffer, charBufferLen, errorHandler, tokenizer
 
Constructor Summary
CoalescingTreeBuilder()
           
 
Method Summary
protected  void accumulateCharacters(char[] buf, int start, int length)
           
protected  void appendCharacters(T parent, char[] buf, int start, int length)
           
protected abstract  void appendCharacters(T parent, java.lang.String text)
           
protected  void appendComment(T parent, char[] buf, int start, int length)
           
protected abstract  void appendComment(T parent, java.lang.String comment)
           
protected  void appendCommentToDocument(char[] buf, int start, int length)
           
protected abstract  void appendCommentToDocument(java.lang.String comment)
           
protected  void appendIsindexPrompt(T parent)
           
protected  void insertFosterParentedCharacters(char[] buf, int start, int length, T table, T stackParent)
           
protected abstract  void insertFosterParentedCharacters(java.lang.String text, T table, T stackParent)
           
 
Methods inherited from class nu.validator.htmlparser.impl.TreeBuilder
addAttributesToElement, appendChildrenToNewParent, appendDoctypeToDocument, appendElement, cdataSectionAllowed, characters, comment, createElement, createElement, createHtmlElementSetAsRoot, currentNode, detachFromParent, doctype, documentMode, elementPopped, elementPushed, end, endTag, endTokenization, eof, extractCharsetFromContent, fatal, fatal, flushCharacters, getDeepTreeSurrogateParent, getErrorHandler, getFormPointer, getHeadPointer, getListOfActiveFormattingElements, getListOfActiveFormattingElementsLength, getMode, getOriginalMode, getStack, getStackLength, hasChildren, insertFosterParentedChild, isFramesetOk, isNeedToDropLF, isQuirks, isScriptingEnabled, loadState, markMalformedIfScript, newSnapshot, requestSuspension, setDoctypeExpectation, setDocumentModeHandler, setErrorHandler, setFragmentContext, setFragmentContext, setIgnoringComments, setNamePolicy, setReportingDoctype, setScriptingEnabled, snapshotMatches, start, startTag, startTokenization, wantsComments, zeroOriginatingReplacementCharacter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoalescingTreeBuilder

public CoalescingTreeBuilder()
Method Detail

accumulateCharacters

protected final void accumulateCharacters(char[] buf,
                                          int start,
                                          int length)
                                   throws org.xml.sax.SAXException
Overrides:
accumulateCharacters in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException

appendCharacters

protected final void appendCharacters(T parent,
                                      char[] buf,
                                      int start,
                                      int length)
                               throws org.xml.sax.SAXException
Specified by:
appendCharacters in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException
See Also:
TreeBuilder.appendCharacters(java.lang.Object, char[], int, int)

appendIsindexPrompt

protected void appendIsindexPrompt(T parent)
                            throws org.xml.sax.SAXException
Specified by:
appendIsindexPrompt in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException
See Also:
TreeBuilder.appendIsindexPrompt(java.lang.Object)

appendCharacters

protected abstract void appendCharacters(T parent,
                                         java.lang.String text)
                                  throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

appendComment

protected final void appendComment(T parent,
                                   char[] buf,
                                   int start,
                                   int length)
                            throws org.xml.sax.SAXException
Specified by:
appendComment in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException
See Also:
TreeBuilder.appendComment(java.lang.Object, char[], int, int)

appendComment

protected abstract void appendComment(T parent,
                                      java.lang.String comment)
                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

appendCommentToDocument

protected final void appendCommentToDocument(char[] buf,
                                             int start,
                                             int length)
                                      throws org.xml.sax.SAXException
Specified by:
appendCommentToDocument in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException
See Also:
TreeBuilder.appendCommentToDocument(char[], int, int)

appendCommentToDocument

protected abstract void appendCommentToDocument(java.lang.String comment)
                                         throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

insertFosterParentedCharacters

protected final void insertFosterParentedCharacters(char[] buf,
                                                    int start,
                                                    int length,
                                                    T table,
                                                    T stackParent)
                                             throws org.xml.sax.SAXException
Specified by:
insertFosterParentedCharacters in class TreeBuilder<T>
Throws:
org.xml.sax.SAXException
See Also:
TreeBuilder.insertFosterParentedCharacters(char[], int, int, java.lang.Object, java.lang.Object)

insertFosterParentedCharacters

protected abstract void insertFosterParentedCharacters(java.lang.String text,
                                                       T table,
                                                       T stackParent)
                                                throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException