Package org.apache.tika.parser.multiple
Class FallbackParser
- java.lang.Object
-
- org.apache.tika.parser.multiple.AbstractMultipleParser
-
- org.apache.tika.parser.multiple.FallbackParser
-
- All Implemented Interfaces:
Serializable
,Parser
public class FallbackParser extends AbstractMultipleParser
Tries multiple parsers in turn, until one succeeds.Can optionally keep Metadata from failed parsers when trying the next one, depending on the
AbstractMultipleParser.MetadataPolicy
chosen.- 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 (all)-
Fields inherited from class org.apache.tika.parser.multiple.AbstractMultipleParser
METADATA_POLICY_CONFIG_KEY
-
-
Constructor Summary
Constructors Constructor Description FallbackParser(MediaTypeRegistry registry, Collection<? extends Parser> parsers, Map<String,Param> params)
FallbackParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Collection<? extends Parser> parsers)
FallbackParser(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 (all)
-
-
Constructor Detail
-
FallbackParser
public FallbackParser(MediaTypeRegistry registry, Collection<? extends Parser> parsers, Map<String,Param> params)
-
FallbackParser
public FallbackParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Collection<? extends Parser> parsers)
-
FallbackParser
public FallbackParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, 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
-
-