Package org.apache.tika.sax
Class ElementMappingContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.ContentHandlerDecorator
-
- org.apache.tika.sax.ElementMappingContentHandler
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class ElementMappingContentHandler extends ContentHandlerDecorator
Content handler decorator that maps elementQNames using aMap. Not mappable elements are not forwarded. Attributes may also be mapped (for each element different using aMapfor attributes), not mappable attributes are not forwarded. The default is to not map any attributes and therefore do not forward any of them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElementMappingContentHandler.TargetElement
-
Constructor Summary
Constructors Constructor Description ElementMappingContentHandler(ContentHandler handler, Map<QName,ElementMappingContentHandler.TargetElement> mappings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendElement(String namespaceURI, String localName, String qName)protected static StringgetQNameAsString(QName qname)voidstartElement(String namespaceURI, String localName, String qName, Attributes atts)-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endDocument, endPrefixMapping, error, fatalError, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, toString, warning
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
ElementMappingContentHandler
public ElementMappingContentHandler(ContentHandler handler, Map<QName,ElementMappingContentHandler.TargetElement> mappings)
-
-
Method Detail
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classContentHandlerDecorator- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classContentHandlerDecorator- Throws:
SAXException
-
-