|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.aliasi.xml.TextAccumulatorHandler
public class TextAccumulatorHandler
A TextAccumulatorHandler simply accumulates all text
content events into a single string buffer. The buffer is reset
with each start document event, but is never freed entirely from
memory.
| Constructor Summary | |
|---|---|
TextAccumulatorHandler()
Construct a text accumulator handler. |
|
TextAccumulatorHandler(int minBufLength)
Construct a text accumulator handler with the specified initial buffer length. |
|
| Method Summary | |
|---|---|
void |
characters(char[] cs,
int start,
int length)
Adds the specified character slice to the string buffer. |
String |
getText()
Returns the text thus far accumulated. |
void |
reset()
Resets the underlying string buffer to the empty state by assigning it to a new buffer of the specified minimum length. |
void |
startDocument()
Resets the string buffer. |
String |
toString()
A convenience implementation returning the same value as getText(), namely the text thus far accumulated. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startElement, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextAccumulatorHandler()
public TextAccumulatorHandler(int minBufLength)
minBufLength - Minimum buffer length to assign to string buffer.| Method Detail |
|---|
public void reset()
public void startDocument()
startDocument in interface ContentHandlerstartDocument in class DefaultHandler
public void characters(char[] cs,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlercs - Characters underlying slice.start - Index of first character in slice.length - Number of characters in slice.public String getText()
public String toString()
getText(), namely the text thus far accumulated.
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||