Class CompositeContentEnricher

java.lang.Object
org.apache.tika.parser.enricher.CompositeContentEnricher
All Implemented Interfaces:
Serializable

public class CompositeContentEnricher extends Object implements Serializable
Media-type-keyed registry of content enrichers: ordinary Parsers that a container parser invokes on bytes it has already parsed (OCR text for an image or a rendered PDF page), rather than being dispatched to by the composite parser. Configured as the top-level "text-recognizers" list, mirroring "renderers"; with no list, the loader builds one from the enrichers among the loaded parsers (ContentEnrichers.resolve(org.apache.tika.parser.Parser)).

Members are keyed by their real media types; a legacy image/ocr-* advertisement is keyed under the real type, with a warning, until 5.0.

Since:
Apache Tika 4.1
See Also:
  • Constructor Details

    • CompositeContentEnricher

      public CompositeContentEnricher(List<Parser> enrichers)
  • Method Details

    • getEnrichers

      public List<Parser> getEnrichers(MediaType mediaType)
      Returns:
      the enrichers for this media type in config order, empty when none; parameters are ignored, alias normalization is the caller's job
    • getSupportedTypes

      public Set<MediaType> getSupportedTypes()
    • isEmpty

      public boolean isEmpty()
      True when no type has an enricher: enrichment is off.
    • isLegacyClaimant

      public boolean isLegacyClaimant(Parser member)
      Whether a member returned by getEnrichers(org.apache.tika.mime.MediaType) is a pre-4.1 engine that advertises only image/ocr-*; such an engine counts as a text recognizer until 5.0.