Package org.apache.tika.serialization
Class ComponentConfig.Builder<T>
java.lang.Object
org.apache.tika.serialization.ComponentConfig.Builder<T>
- Enclosing class:
- ComponentConfig<T>
Builder for ComponentConfig.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the ComponentConfig.customLoader(ComponentLoader<T> loader) Configure a custom loader for complex components that need special handling (SPI fallback, dependency injection, etc.).defaultProvider(Supplier<T> provider) Configure a default value to return when the JSON field is absent.Configure this component to be loaded as a list from JSON.voidregister()Build and register with ComponentNameResolver.Configure how to wrap a list into the component type.
-
Method Details
-
loadAsList
Configure this component to be loaded as a list from JSON. -
wrapWith
Configure how to wrap a list into the component type. For example, List<Parser> → CompositeParser.- Parameters:
wrapper- function that takes a list and returns the wrapped component
-
defaultProvider
Configure a default value to return when the JSON field is absent.- Parameters:
provider- supplier that creates the default instance
-
customLoader
Configure a custom loader for complex components that need special handling (SPI fallback, dependency injection, etc.).When a custom loader is set, it takes precedence over the default list-based loading.
- Parameters:
loader- the custom loader
-
build
Build the ComponentConfig. -
register
public void register()Build and register with ComponentNameResolver.
-