Package org.apache.tika.sax.xpath
Class MatchingContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.ContentHandlerDecorator
-
- org.apache.tika.sax.xpath.MatchingContentHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class MatchingContentHandler extends ContentHandlerDecorator
Content handler decorator that only passes the elements, attributes, and text nodes that match the given XPath expression.
-
-
Constructor Summary
Constructors Constructor Description MatchingContentHandler(ContentHandler delegate, Matcher matcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendElement(String uri, String localName, String name)voidignorableWhitespace(char[] ch, int start, int length)voidprocessingInstruction(String target, String data)voidskippedEntity(String name)voidstartElement(String uri, String localName, String name, Attributes attributes)-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, error, fatalError, handleException, setContentHandler, setDocumentLocator, startDocument, startPrefixMapping, toString, warning
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
MatchingContentHandler
public MatchingContentHandler(ContentHandler delegate, Matcher matcher)
-
-
Method Detail
-
startElement
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classContentHandlerDecorator- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String name) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classContentHandlerDecorator- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classContentHandlerDecorator- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException- Specified by:
ignorableWhitespacein interfaceContentHandler- Overrides:
ignorableWhitespacein classContentHandlerDecorator- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data)
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classContentHandlerDecorator
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Overrides:
skippedEntityin classContentHandlerDecorator- Throws:
SAXException
-
-