Package org.apache.tika.sax
Class TextContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.TextContentHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
TextAndAttributeContentHandler
public class TextContentHandler extends DefaultHandler
Content handler decorator that only passes thecharacters(char[], int, int)
and (@linkignorableWhitespace(char[], int, int)
(plusstartDocument()
andendDocument()
events to the decorated content handler.
-
-
Constructor Summary
Constructors Constructor Description TextContentHandler(ContentHandler delegate)
TextContentHandler(ContentHandler delegate, boolean addSpaceBetweenElements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endDocument()
void
ignorableWhitespace(char[] ch, int start, int length)
void
setDocumentLocator(Locator locator)
void
startDocument()
void
startElement(String uri, String localName, String qName, Attributes attributes)
String
toString()
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endElement, endPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
TextContentHandler
public TextContentHandler(ContentHandler delegate)
-
TextContentHandler
public TextContentHandler(ContentHandler delegate, boolean addSpaceBetweenElements)
-
-
Method Detail
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
-