# Class CoalescingTreeBuilder<T>

java.lang.Object
nu.validator.htmlparser.impl.TreeBuilder<T>
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 TreeBuilder

`charBuffer, charBufferLen, errorHandler, tokenizer`

## Constructor Summary

Constructors
Constructor
Description
`CoalescingTreeBuilder()`

## Method Summary

Modifier and Type
Method
Description
`protected final void`
`accumulateCharacters(char[] buf, int start, int length)`
`protected final void`
`appendCharacters(T parent, char[] buf, int start, int length)`
`protected abstract void`
`appendCharacters(T parent, String text)`
`protected final void`
`appendComment(T parent, char[] buf, int start, int length)`
`protected abstract void`
`appendComment(T parent, String comment)`
`protected final void`
`appendCommentToDocument(char[] buf, int start, int length)`
`protected abstract void`
`appendCommentToDocument(String comment)`
`protected final void`
`insertFosterParentedCharacters(char[] buf, int start, int length, T table, T stackParent)`
`protected abstract void`
`insertFosterParentedCharacters(String text, T table, T stackParent)`

### Methods inherited from class TreeBuilder

`addAttributesToElement, appendChildrenToNewParent, appendDoctypeToDocument, appendElement, cdataSectionAllowed, characters, comment, createAndInsertFosterParentedElement, createAndInsertFosterParentedElement, createElement, createElement, createHtmlElementSetAsRoot, currentNode, detachFromParent, doctype, documentMode, dropBufferIfLongerThan, elementPopped, elementPushed, end, endTag, endTokenization, ensureBufferSpace, eof, extractCharsetFromContent, fatal, fatal, flushCharacters, getErrorHandler, getFormPointer, getHeadPointer, getListOfActiveFormattingElements, getListOfActiveFormattingElementsLength, getMode, getOriginalMode, getStack, getStackLength, getTemplateModeStack, getTemplateModeStackLength, hasChildren, insertFosterParentedChild, isAllowDeclarativeShadowRoots, isFramesetOk, isNeedToDropLF, isQuirks, isScriptingEnabled, loadState, markMalformedIfScript, newSnapshot, optionElementPopped, requestSuspension, setAllowDeclarativeShadowRoots, setDocumentModeHandler, setErrorHandler, setForceNoQuirks, setFragmentContext, setFragmentContext, setIgnoringComments, setIsSrcdocDocument, setKeepBuffer, setNamePolicy, setReportingDoctype, setScriptingEnabled, snapshotMatches, start, startTag, startTokenization, wantsComments, zeroOriginatingReplacementCharacter, zeroOrReplacementCharacter`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CoalescingTreeBuilder

public CoalescingTreeBuilder()

## Method Details

### accumulateCharacters

protected final void accumulateCharacters(char[] buf, int start, int length) throws SAXException

Overrides:
  `accumulateCharacters` in class `TreeBuilder<T>`
Throws:
  `SAXException`

### appendCharacters

protected final void appendCharacters(T parent, char[] buf, int start, int length) throws SAXException

Specified by:
  `appendCharacters` in class `TreeBuilder<T>`
Throws:
  `SAXException`
See Also:
  - `TreeBuilder.appendCharacters(java.lang.Object, char[], int, int)`

### appendCharacters

protected abstract void appendCharacters(T parent, String text) throws SAXException

Throws:
  `SAXException`

### appendComment

protected final void appendComment(T parent, char[] buf, int start, int length) throws SAXException

Specified by:
  `appendComment` in class `TreeBuilder<T>`
Throws:
  `SAXException`
See Also:
  - `TreeBuilder.appendComment(java.lang.Object, char[], int, int)`

### appendComment

protected abstract void appendComment(T parent, String comment) throws SAXException

Throws:
  `SAXException`

### appendCommentToDocument

protected final void appendCommentToDocument(char[] buf, int start, int length) throws SAXException

Specified by:
  `appendCommentToDocument` in class `TreeBuilder<T>`
Throws:
  `SAXException`
See Also:
  - `TreeBuilder.appendCommentToDocument(char[], int, int)`

### appendCommentToDocument

protected abstract void appendCommentToDocument(String comment) throws SAXException

Throws:
  `SAXException`

### insertFosterParentedCharacters

protected final void insertFosterParentedCharacters(char[] buf, int start, int length, T table, T stackParent) throws SAXException

Specified by:
  `insertFosterParentedCharacters` in class `TreeBuilder<T>`
Throws:
  `SAXException`
See Also:
  - `TreeBuilder.insertFosterParentedCharacters(char[], int, int, java.lang.Object, java.lang.Object)`

### insertFosterParentedCharacters

protected abstract void insertFosterParentedCharacters(String text, T table, T stackParent) throws SAXException

Throws:
  `SAXException`