Class ParseContextUtils

java.lang.Object
org.apache.tika.serialization.ParseContextUtils

public class ParseContextUtils extends Object
Utility methods for working with ParseContext objects in JSON-based configurations.

Uses friendly-name format for configuration:

 "parse-context": {
   "timeout-limits": {
     "progressTimeoutMillis": 60000
   },
   "pdf-parser": {
     "extractInlineImages": true
   }
 }
 

Components that implement SelfConfiguring are skipped during resolution - they read their own config from jsonConfigs at runtime.

  • Constructor Details

    • ParseContextUtils

      public ParseContextUtils()
  • Method Details

    • resolveAll

      public static void resolveAll(ParseContext context, ClassLoader classLoader) throws TikaConfigException
      Resolves all JSON configs from ParseContext and adds them to the resolved cache.

      Iterates through all entries in jsonConfigs, looks up the friendly name in ComponentNameResolver (which searches all registered component registries), deserializes the JSON, and caches the instance in resolvedConfigs.

      Components that implement SelfConfiguring are skipped - they read their own config at runtime via ConfigDeserializer.

      The ParseContext key is determined by the contextKey from the .idx file, which is auto-detected by the annotation processor from the service interface, or explicitly specified via @TikaComponent(contextKey=...). Falls back to the component class if no contextKey is available.

      Parameters:
      context - the ParseContext to populate
      classLoader - the ClassLoader to use for loading component classes
      Throws:
      TikaConfigException