Package org.apache.tika.parser.multiple
Class SupplementingParser
- java.lang.Object
-
- org.apache.tika.parser.multiple.AbstractMultipleParser
-
- org.apache.tika.parser.multiple.SupplementingParser
-
- All Implemented Interfaces:
Serializable
,Parser
public class SupplementingParser extends AbstractMultipleParser
Runs the input stream through all available parsers, merging the metadata from them based on theAbstractMultipleParser.MetadataPolicy
chosen.Warning - currently only one Parser should output any Content to the
ContentHandler
, the rest should only outputMetadata
. A solution to multiple-content is still being worked on...- Since:
- Apache Tika 1.18
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
AbstractMultipleParser.MetadataPolicy
-
-
Field Summary
Fields Modifier and Type Field Description static List<AbstractMultipleParser.MetadataPolicy>
allowedPolicies
The different Metadata Policies we support (not discard)-
Fields inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
METADATA_POLICY_CONFIG_KEY
-
-
Constructor Summary
Constructors Constructor Description SupplementingParser(MediaTypeRegistry registry, Collection<? extends Parser> parsers, Map<String,Param> params)
SupplementingParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Collection<? extends Parser> parsers)
SupplementingParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Parser... parsers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
parserCompleted(Parser parser, Metadata metadata, ContentHandler handler, ParseContext context, Exception exception)
Used to notify implementations that a Parser has Finished or Failed, and to allow them to decide to continue or abort further parsing-
Methods inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
getAllParsers, getMediaTypeRegistry, getMetadataPolicy, getMetadataPolicy, getSupportedTypes, mergeMetadata, parse, parse, parserPrepare, setMediaTypeRegistry
-
-
-
-
Field Detail
-
allowedPolicies
public static final List<AbstractMultipleParser.MetadataPolicy> allowedPolicies
The different Metadata Policies we support (not discard)
-
-
Constructor Detail
-
SupplementingParser
public SupplementingParser(MediaTypeRegistry registry, Collection<? extends Parser> parsers, Map<String,Param> params)
-
SupplementingParser
public SupplementingParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Parser... parsers)
-
SupplementingParser
public SupplementingParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Collection<? extends Parser> parsers)
-
-
Method Detail
-
parserCompleted
protected boolean parserCompleted(Parser parser, Metadata metadata, ContentHandler handler, ParseContext context, Exception exception)
Description copied from class:AbstractMultipleParser
Used to notify implementations that a Parser has Finished or Failed, and to allow them to decide to continue or abort further parsing- Specified by:
parserCompleted
in classAbstractMultipleParser
-
-