public class FallbackParser extends AbstractMultipleParser
Can optionally keep Metadata from failed parsers when
trying the next one, depending on the AbstractMultipleParser.MetadataPolicy
chosen.
AbstractMultipleParser.MetadataPolicy
Modifier and Type | Field and Description |
---|---|
static List<AbstractMultipleParser.MetadataPolicy> |
allowedPolicies
The different Metadata Policies we support (all)
|
METADATA_POLICY_CONFIG_KEY
Constructor and Description |
---|
FallbackParser(MediaTypeRegistry registry,
AbstractMultipleParser.MetadataPolicy policy,
Collection<? extends Parser> parsers) |
FallbackParser(MediaTypeRegistry registry,
AbstractMultipleParser.MetadataPolicy policy,
Parser... parsers) |
FallbackParser(MediaTypeRegistry registry,
Collection<? extends Parser> parsers,
Map<String,Param> params) |
Modifier and Type | Method and 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
|
getAllParsers, getMediaTypeRegistry, getMetadataPolicy, getMetadataPolicy, getSupportedTypes, mergeMetadata, parse, parse, parserPrepare, setMediaTypeRegistry
parse
public static final List<AbstractMultipleParser.MetadataPolicy> allowedPolicies
public FallbackParser(MediaTypeRegistry registry, Collection<? extends Parser> parsers, Map<String,Param> params)
public FallbackParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Collection<? extends Parser> parsers)
public FallbackParser(MediaTypeRegistry registry, AbstractMultipleParser.MetadataPolicy policy, Parser... parsers)
protected boolean parserCompleted(Parser parser, Metadata metadata, ContentHandler handler, ParseContext context, Exception exception)
AbstractMultipleParser
parserCompleted
in class AbstractMultipleParser
Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.