org.apache.tika.sax.xpath
Class MatchingContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.tika.sax.ContentHandlerDecorator
          extended by 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
MatchingContentHandler(ContentHandler delegate, Matcher matcher)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(String uri, String localName, String name)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(String target, String data)
           
 void skippedEntity(String name)
           
 void startElement(String uri, String localName, String name, Attributes attributes)
           
 
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, handleException, setContentHandler, setDocumentLocator, startDocument, startPrefixMapping, toString
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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:
startElement in interface ContentHandler
Overrides:
startElement in class ContentHandlerDecorator
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String name)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class ContentHandlerDecorator
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class ContentHandlerDecorator
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class ContentHandlerDecorator
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class ContentHandlerDecorator

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class ContentHandlerDecorator
Throws:
SAXException


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.