org.apache.tika.sax
Class EndDocumentShieldingContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.tika.sax.ContentHandlerDecorator
          extended by org.apache.tika.sax.EndDocumentShieldingContentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class EndDocumentShieldingContentHandler
extends ContentHandlerDecorator

A wrapper around a ContentHandler which will ignore normal SAX calls to endDocument(), and only fire them later. This is typically used to ensure that we can output the metadata before ending the document


Constructor Summary
EndDocumentShieldingContentHandler(ContentHandler handler)
          Creates a decorator for the given SAX event handler.
 
Method Summary
 void endDocument()
           
 boolean getEndDocumentWasCalled()
           
 void reallyEndDocument()
           
 
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endElement, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, startElement, 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

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

reallyEndDocument

public void reallyEndDocument()
                       throws SAXException
Throws:
SAXException

getEndDocumentWasCalled

public boolean getEndDocumentWasCalled()


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