Package org.apache.tika.serialization
Class ComponentConfig<T>
java.lang.Object
org.apache.tika.serialization.ComponentConfig<T>
- Type Parameters:
T- the component type (e.g., Parser, Detector)
Configuration for how to load a top-level component from JSON.
Specifies:
- The JSON field name (e.g., "parsers", "detectors")
- Whether to load as a list or single object
- How to wrap a list into a composite object (e.g., List<Parser> → CompositeParser)
- What default to return if the field is absent
- Optional custom loader for complex components
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ComponentConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ComponentConfig.Builder<T>Creates a new builder for ComponentConfig.Gets the custom loader for this component.booleanReturns true if this component has a custom loader.booleanbooleanboolean
-
Method Details
-
getJsonField
-
getComponentClass
-
isLoadAsList
public boolean isLoadAsList() -
wrapList
-
hasListWrapper
public boolean hasListWrapper() -
getDefault
-
hasDefault
public boolean hasDefault() -
hasCustomLoader
public boolean hasCustomLoader()Returns true if this component has a custom loader. -
getCustomLoader
Gets the custom loader for this component. -
builder
Creates a new builder for ComponentConfig.- Parameters:
jsonField- the JSON field name (e.g., "parsers")componentClass- the component interface (e.g., Parser.class)- Returns:
- a new builder
-