Class StrictTypeIdResolver

java.lang.Object
com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
org.apache.druid.jackson.StrictTypeIdResolver
All Implemented Interfaces:
com.fasterxml.jackson.databind.jsontype.TypeIdResolver

public class StrictTypeIdResolver extends com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
A strict TypeIdResolver implementation that validates all incoming type ids.

During deserialization, the type discriminator in the JSON must correspond to a registered subtype; otherwise this resolver will throw an exception instead of silently accepting or defaulting.

An optional default implementation may still be configured and used only when the type id is absent.

  • Field Details

    • baseType

      protected final com.fasterxml.jackson.databind.JavaType baseType
    • delegate

      protected final com.fasterxml.jackson.databind.jsontype.impl.TypeNameIdResolver delegate
  • Method Details

    • typeFromId

      public com.fasterxml.jackson.databind.JavaType typeFromId(com.fasterxml.jackson.databind.DatabindContext context, String id) throws com.fasterxml.jackson.core.JsonProcessingException
      Specified by:
      typeFromId in interface com.fasterxml.jackson.databind.jsontype.TypeIdResolver
      Overrides:
      typeFromId in class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • idFromValue

      public String idFromValue(Object value)
    • idFromValueAndType

      public String idFromValueAndType(Object value, Class<?> suggestedType)
    • getDescForKnownTypeIds

      public String getDescForKnownTypeIds()
      Specified by:
      getDescForKnownTypeIds in interface com.fasterxml.jackson.databind.jsontype.TypeIdResolver
      Overrides:
      getDescForKnownTypeIds in class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
    • getMechanism

      public com.fasterxml.jackson.annotation.JsonTypeInfo.Id getMechanism()