Class TikaModule

java.lang.Object
com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.module.SimpleModule
org.apache.tika.serialization.TikaModule
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

public class TikaModule extends com.fasterxml.jackson.databind.module.SimpleModule
Jackson module that provides compact serialization for Tika components.

Uses ComponentNameResolver for friendly name resolution (e.g., "pdf-parser").

Supports two formats:

  1. Simple string: "text-parser" → instance with defaults
  2. Object with type as key: {"pdf-parser": {"ocrStrategy": "AUTO"}} → instance with config

For components implementing SelfConfiguring, uses the JsonConfig constructor. For other components, uses Jackson bean deserialization (readerForUpdating).

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module

    com.fasterxml.jackson.databind.Module.SetupContext
  • Field Summary

    Fields inherited from class com.fasterxml.jackson.databind.module.SimpleModule

    _abstractTypes, _deserializerModifier, _deserializers, _hasExplicitName, _keyDeserializers, _keySerializers, _mixins, _name, _namingStrategy, _serializerModifier, _serializers, _subtypes, _valueInstantiators, _version
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.fasterxml.jackson.databind.ObjectMapper
    Gets the shared ObjectMapper.
    static void
    setSharedMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
    Sets the shared ObjectMapper for use during deserialization.
    void
    setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
     

    Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule

    _checkNotNull, addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, getTypeId, registerSubtypes, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setValueInstantiators, version

    Methods inherited from class com.fasterxml.jackson.databind.Module

    getDependencies

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TikaModule

      public TikaModule()
  • Method Details

    • setSharedMapper

      public static void setSharedMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Sets the shared ObjectMapper for use during deserialization. Must be called before deserializing components.
      Parameters:
      mapper - the ObjectMapper with TikaModule registered
    • getSharedMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getSharedMapper()
      Gets the shared ObjectMapper.
      Returns:
      the shared mapper, or null if not configured
    • setupModule

      public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
      Overrides:
      setupModule in class com.fasterxml.jackson.databind.module.SimpleModule