|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler org.apache.tika.sax.ToTextContentHandler
public class ToTextContentHandler
SAX event handler that writes all character content out to a character stream. No escaping or other transformations are made on the character content.
Constructor Summary | |
---|---|
ToTextContentHandler()
Creates a content handler that writes character events to an internal string buffer. |
|
ToTextContentHandler(OutputStream stream)
Creates a content handler that writes character events to the given output stream using the platform default encoding. |
|
ToTextContentHandler(OutputStream stream,
String encoding)
Creates a content handler that writes character events to the given output stream using the given encoding. |
|
ToTextContentHandler(Writer writer)
Creates a content handler that writes character events to the given writer. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Writes the given characters to the given character stream. |
void |
endDocument()
Flushes the character stream so that no characters are forgotten in internal buffers. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Writes the given ignorable characters to the given character stream. |
String |
toString()
Returns the contents of the internal string buffer where all the received characters have been collected. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endElement, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ToTextContentHandler(Writer writer)
writer
- writerpublic ToTextContentHandler(OutputStream stream)
stream
- output streampublic ToTextContentHandler(OutputStream stream, String encoding) throws UnsupportedEncodingException
stream
- output streamencoding
- output encoding
UnsupportedEncodingException
- if the encoding is unsupportedpublic ToTextContentHandler()
toString()
method to access the collected character content.
Method Detail |
---|
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
characters(char[], int, int)
method.
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
SAXException
- if the stream can not be flushedpublic String toString()
StringWriter
to the
other constructor.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |