Package org.apache.tika.sax
Class EndDocumentShieldingContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.tika.sax.ContentHandlerDecorator
-
- org.apache.tika.sax.EndDocumentShieldingContentHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class EndDocumentShieldingContentHandler extends ContentHandlerDecorator
A wrapper around aContentHandler
which will ignore normal SAX calls toendDocument()
, and only fire them later. This is typically used to ensure that we can output the metadata before ending the document
-
-
Constructor Summary
Constructors Constructor Description EndDocumentShieldingContentHandler(ContentHandler handler)
Creates a decorator for the given SAX event handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endDocument()
boolean
isEndDocumentWasCalled()
void
reallyEndDocument()
-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endElement, endPrefixMapping, error, fatalError, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, toString, warning
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
-
-
-
-
Constructor Detail
-
EndDocumentShieldingContentHandler
public EndDocumentShieldingContentHandler(ContentHandler handler)
Creates a decorator for the given SAX event handler.- Parameters:
handler
- SAX event handler to be decorated
-
-
Method Detail
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classContentHandlerDecorator
- Throws:
SAXException
-
reallyEndDocument
public void reallyEndDocument() throws SAXException
- Throws:
SAXException
-
isEndDocumentWasCalled
public boolean isEndDocumentWasCalled()
-
-