Package org.apache.tika.sax
Class ToTextContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.ToTextContentHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
ToXMLContentHandler
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
SAX event handler that writes all character content out to a character
stream. No escaping or other transformations are made on the character
content.
As of Tika 1.20, this handler ignores content within <script> and <style> tags.
- Since:
- Apache Tika 0.10
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a content handler that writes character events to an internal string buffer.ToTextContentHandler(OutputStream stream) Deprecated.Creates a content handler that writes character events to the given output stream using the platform default encoding.ToTextContentHandler(OutputStream stream, String encoding) Deprecated.Creates a content handler that writes character events to the given output stream using the given encoding.ToTextContentHandler(Writer writer) Deprecated.Creates a content handler that writes character events to the given writer. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Deprecated.Writes the given characters to the given character stream.voidDeprecated.Flushes the character stream so that no characters are forgotten in internal buffers.voidendElement(String uri, String localName, String qName) Deprecated.voidignorableWhitespace(char[] ch, int start, int length) Deprecated.Writes the given ignorable characters to the given character stream.voidstartElement(String uri, String localName, String qName, Attributes atts) Deprecated.toString()Deprecated.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
endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
ToTextContentHandler
Deprecated.Creates a content handler that writes character events to the given writer.- Parameters:
writer- writer
-
ToTextContentHandler
Deprecated.Creates a content handler that writes character events to the given output stream using the platform default encoding.- Parameters:
stream- output stream
-
ToTextContentHandler
public ToTextContentHandler(OutputStream stream, String encoding) throws UnsupportedEncodingException Deprecated.Creates a content handler that writes character events to the given output stream using the given encoding.- Parameters:
stream- output streamencoding- output encoding- Throws:
UnsupportedEncodingException- if the encoding is unsupported
-
ToTextContentHandler
public ToTextContentHandler()Deprecated.Creates a content handler that writes character events to an internal string buffer. Use thetoString()method to access the collected character content.
-
-
Method Details
-
characters
Deprecated.Writes the given characters to the given character stream.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
ignorableWhitespace
Deprecated.Writes the given ignorable characters to the given character stream. The default implementation simply forwards the call to thecharacters(char[], int, int)method.- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classDefaultHandler- Throws:
SAXException
-
endDocument
Deprecated.Flushes the character stream so that no characters are forgotten in internal buffers.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException- if the stream can not be flushed- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException Deprecated.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
Deprecated.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
toString
Deprecated.Returns the contents of the internal string buffer where all the received characters have been collected. Only works when this object was constructed using the empty default constructor or by passing aStringWriterto the other constructor.
-