Package org.apache.tika.parser.multiple
Class SupplementingParser
java.lang.Object
org.apache.tika.parser.AbstractParser
org.apache.tika.parser.multiple.AbstractMultipleParser
org.apache.tika.parser.multiple.SupplementingParser
- All Implemented Interfaces:
Serializable
,Parser
Runs the input stream through all available parsers,
merging the metadata from them based on the
AbstractMultipleParser.MetadataPolicy
chosen.
Warning - currently only one Parser should output
any Content to the ContentHandler
, the rest
should only output Metadata
. A solution to
multiple-content is still being worked on...
- Since:
- Apache Tika 1.18
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
AbstractMultipleParser.MetadataPolicy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final List<AbstractMultipleParser.MetadataPolicy>
The different Metadata Policies we support (not discard)Fields inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
METADATA_POLICY_CONFIG_KEY
-
Constructor Summary
ConstructorDescriptionSupplementingParser
(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
Modifier and TypeMethodDescriptionprotected 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 parsingMethods inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
getAllParsers, getMediaTypeRegistry, getMetadataPolicy, getMetadataPolicy, getSupportedTypes, mergeMetadata, parse, parse, parserPrepare, setMediaTypeRegistry
Methods inherited from class org.apache.tika.parser.AbstractParser
parse
-
Field Details
-
allowedPolicies
The different Metadata Policies we support (not discard)
-
-
Constructor Details
-
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 Details
-
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
-