Class SpiCompositeSerializer<T>

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
org.apache.tika.serialization.serdes.SpiCompositeSerializer<T>
Type Parameters:
T - the composite type (e.g., DefaultDetector, DefaultParser)
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
Direct Known Subclasses:
DefaultDetectorSerializer, DefaultParserSerializer

public abstract class SpiCompositeSerializer<T> extends com.fasterxml.jackson.databind.JsonSerializer<T>
Abstract base serializer for SPI-loaded composite types that support exclusions.

Outputs JSON like:

 "default-detector"  // if no exclusions
 { "default-detector": { "exclude": ["html-detector", "zip-detector"] } }  // with exclusions
 
  • Nested Class Summary

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

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract Set<Class<?>>
    Get the excluded classes from the composite instance.
    void
    serialize(T value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers)
     

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

    acceptJsonFormatVisitor, getDelegatee, handledType, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties

    Methods inherited from class java.lang.Object

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

    • typeName

      protected final String typeName
  • Constructor Details

    • SpiCompositeSerializer

      protected SpiCompositeSerializer(String typeName)
  • Method Details

    • serialize

      public void serialize(T value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider serializers) throws IOException
      Specified by:
      serialize in class com.fasterxml.jackson.databind.JsonSerializer<T>
      Throws:
      IOException
    • getExcludedClasses

      protected abstract Set<Class<?>> getExcludedClasses(T value)
      Get the excluded classes from the composite instance.
      Parameters:
      value - the composite instance
      Returns:
      the set of excluded classes, or null/empty if none