Package org.apache.tika.config.loader
Class EncodingDetectorLoader
java.lang.Object
org.apache.tika.config.loader.AbstractSpiComponentLoader<EncodingDetector>
org.apache.tika.config.loader.EncodingDetectorLoader
- All Implemented Interfaces:
ComponentLoader<EncodingDetector>
Loader for encoding detectors with support for SPI fallback via
"default-encoding-detector" marker.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EncodingDetectorcreateDefaultComposite(Set<Class<? extends EncodingDetector>> exclusions, LoaderContext context) Create the SPI-backed default composite with exclusions.protected EncodingDetectorloadComponent(String name, com.fasterxml.jackson.databind.JsonNode configNode, LoaderContext context) Load a single component from config.protected EncodingDetectorwrapInComposite(List<EncodingDetector> detectors, LoaderContext context) Wrap a list of components in a composite.Methods inherited from class org.apache.tika.config.loader.AbstractSpiComponentLoader
decorateDefaultComposite, getComponentClass, getDefaultMarkerName, getSectionName, handleSpecialName, load, postProcess, postProcessList, unwrapClass
-
Constructor Details
-
EncodingDetectorLoader
public EncodingDetectorLoader()
-
-
Method Details
-
loadComponent
protected EncodingDetector loadComponent(String name, com.fasterxml.jackson.databind.JsonNode configNode, LoaderContext context) throws TikaConfigException Description copied from class:AbstractSpiComponentLoaderLoad a single component from config. Subclasses can apply decorations (e.g., mime filtering for parsers).- Specified by:
loadComponentin classAbstractSpiComponentLoader<EncodingDetector>- Parameters:
name- the component name (friendly name or FQCN)configNode- the JSON configuration for this componentcontext- the loader context- Returns:
- the loaded component
- Throws:
TikaConfigException- if loading fails
-
createDefaultComposite
protected EncodingDetector createDefaultComposite(Set<Class<? extends EncodingDetector>> exclusions, LoaderContext context) Description copied from class:AbstractSpiComponentLoaderCreate the SPI-backed default composite with exclusions. E.g., new DefaultParser(..., exclusions) or new DefaultDetector(..., exclusions)- Specified by:
createDefaultCompositein classAbstractSpiComponentLoader<EncodingDetector>- Parameters:
exclusions- classes to exclude from SPI loadingcontext- the loader context- Returns:
- the default composite
-
wrapInComposite
Description copied from class:AbstractSpiComponentLoaderWrap a list of components in a composite. E.g., new CompositeParser(registry, list) or new CompositeDetector(registry, list)- Specified by:
wrapInCompositein classAbstractSpiComponentLoader<EncodingDetector>- Parameters:
detectors- the list of componentscontext- the loader context- Returns:
- the composite component
-