Package org.apache.tika.parser.odf
Class NSNormalizerContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.ContentHandlerDecorator
-
- org.apache.tika.parser.odf.NSNormalizerContentHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class NSNormalizerContentHandler extends ContentHandlerDecorator
Content handler decorator that:- Maps old OpenOffice 1.0 Namespaces to the OpenDocument ones
- Returns a fake DTD when parser requests OpenOffice DTD
-
-
Constructor Summary
Constructors Constructor Description NSNormalizerContentHandler(ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(String namespaceURI, String localName, String qName)
InputSource
resolveEntity(String publicId, String systemId)
do not load any DTDs (may be requested by parser).void
startElement(String namespaceURI, String localName, String qName, Attributes atts)
void
startPrefixMapping(String prefix, String uri)
-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endDocument, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, toString
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
NSNormalizerContentHandler
public NSNormalizerContentHandler(ContentHandler handler)
-
-
Method Detail
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classContentHandlerDecorator
- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classContentHandlerDecorator
- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classContentHandlerDecorator
- Throws:
SAXException
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
do not load any DTDs (may be requested by parser). Fake the DTD by returning a empty string as InputSource- Specified by:
resolveEntity
in interfaceEntityResolver
- Overrides:
resolveEntity
in classDefaultHandler
- Throws:
IOException
SAXException
-
-