Class ComponentConfig.Builder<T>

java.lang.Object
org.apache.tika.serialization.ComponentConfig.Builder<T>
Enclosing class:
ComponentConfig<T>

public static class ComponentConfig.Builder<T> extends Object
Builder for ComponentConfig.
  • Method Details

    • loadAsList

      public ComponentConfig.Builder<T> loadAsList()
      Configure this component to be loaded as a list from JSON.
    • wrapWith

      public ComponentConfig.Builder<T> wrapWith(Function<List<?>,T> wrapper)
      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

      public ComponentConfig.Builder<T> defaultProvider(Supplier<T> provider)
      Configure a default value to return when the JSON field is absent.
      Parameters:
      provider - supplier that creates the default instance
    • customLoader

      public ComponentConfig.Builder<T> customLoader(ComponentLoader<T> loader)
      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

      public ComponentConfig<T> build()
      Build the ComponentConfig.
    • register

      public void register()
      Build and register with ComponentNameResolver.