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:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class ElementMappingContentHandler extends ContentHandlerDecorator
Content handler decorator that maps elementQName
s using aMap
. Not mappable elements are not forwarded. Attributes may also be mapped (for each element different using aMap
for 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 class
ElementMappingContentHandler.TargetElement
-
Constructor Summary
Constructors Constructor Description ElementMappingContentHandler(org.xml.sax.ContentHandler handler, java.util.Map<javax.xml.namespace.QName,ElementMappingContentHandler.TargetElement> mappings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
void
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, toString
-
-
-
-
Constructor Detail
-
ElementMappingContentHandler
public ElementMappingContentHandler(org.xml.sax.ContentHandler handler, java.util.Map<javax.xml.namespace.QName,ElementMappingContentHandler.TargetElement> mappings)
-
-
Method Detail
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
-