Class RecursiveParserWrapperHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.AbstractRecursiveParserWrapperHandler
org.apache.tika.sax.RecursiveParserWrapperHandler
- All Implemented Interfaces:
Serializable, ContentHandler, DTDHandler, EntityResolver, ErrorHandler
This is the default implementation of
AbstractRecursiveParserWrapperHandler.
See its documentation for more details.
This caches the a metadata object for each embedded file and for the container file.
It places the extracted content in the metadata object, with this key:
TikaCoreProperties.TIKA_CONTENT
If memory is a concern, subclass AbstractRecursiveParserWrapperHandler to handle each
embedded document.
NOTE: This handler must only be used with the RecursiveParserWrapper
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractRecursiveParserWrapperHandler
EMBEDDED_DEPTH_LIMIT_REACHED, EMBEDDED_RESOURCE_LIMIT_REACHED -
Constructor Summary
ConstructorsConstructorDescriptionRecursiveParserWrapperHandler(ContentHandlerFactory contentHandlerFactory) Create a handler for recursive parsing. -
Method Summary
Modifier and TypeMethodDescriptionvoidendDocument(ContentHandler contentHandler, Metadata metadata) This is called after the full parse has completed.voidendEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) This is called after parsing an embedded document.voidstartEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) This is called before parsing an embedded documentMethods inherited from class AbstractRecursiveParserWrapperHandler
createHandler, decrementEmbeddedDepth, getContentHandlerFactoryMethods inherited from class DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
declaration
-
Field Details
-
metadataList
-
-
Constructor Details
-
RecursiveParserWrapperHandler
Create a handler for recursive parsing.Embedded resource limits are now configured via
EmbeddedLimitsin the ParseContext, not on the handler.- Parameters:
contentHandlerFactory- factory for creating content handlers
-
-
Method Details
-
startEmbeddedDocument
public void startEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) throws SAXException This is called before parsing an embedded document- Overrides:
startEmbeddedDocumentin classAbstractRecursiveParserWrapperHandler- Parameters:
contentHandler- - local content handler to use on the embedded documentmetadata- metadata to use for the embedded document- Throws:
SAXException
-
endEmbeddedDocument
public void endEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) throws SAXException This is called after parsing an embedded document.- Overrides:
endEmbeddedDocumentin classAbstractRecursiveParserWrapperHandler- Parameters:
contentHandler- local contenthandler used on the embedded documentmetadata- metadata from the embedded document- Throws:
SAXException
-
endDocument
Description copied from class:AbstractRecursiveParserWrapperHandlerThis is called after the full parse has completed. Override this for custom behavior. Make sure to call this assuper.endDocument(...)in subclasses.- Overrides:
endDocumentin classAbstractRecursiveParserWrapperHandler- Parameters:
contentHandler- content handler used on the main documentmetadata- metadata from the main document- Throws:
SAXException
-
getMetadataList
-