Class NoOpTypeDeserializer

java.lang.Object
tools.jackson.databind.jsontype.TypeDeserializer
tools.jackson.databind.jsontype.impl.NoOpTypeDeserializer

public class NoOpTypeDeserializer extends TypeDeserializer
Special TypeDeserializer implementation used to explicitly block type deserialization. This is used when a property or class is annotated with @JsonTypeInfo(use = Id.NONE), indicating that type information should not be expected or processed even if the value type has a class-level type info annotation.

Unlike returning null (which means "no special type handling, use defaults"), this actively prevents type information from being read.

Since:
3.1
  • Method Details

    • forBaseType

      public static NoOpTypeDeserializer forBaseType(DeserializationContext ctxt, JavaType baseType)
    • forProperty

      public TypeDeserializer forProperty(BeanProperty prop)
      Description copied from class: TypeDeserializer
      Method called to create contextual version, to be used for values of given property. This may be the type itself (as is the case for bean properties), or values contained (for Collection or Map valued properties).
      Specified by:
      forProperty in class TypeDeserializer
    • getTypeInclusion

      public JsonTypeInfo.As getTypeInclusion()
      Description copied from class: TypeDeserializer
      Accessor for type information inclusion method that deserializer uses; indicates how type information is (expected to be) embedded in JSON input.
      Specified by:
      getTypeInclusion in class TypeDeserializer
    • getPropertyName

      public String getPropertyName()
      Description copied from class: TypeDeserializer
      Name of property that contains type information, if property-based inclusion is used.
      Specified by:
      getPropertyName in class TypeDeserializer
    • getTypeIdResolver

      public TypeIdResolver getTypeIdResolver()
      Description copied from class: TypeDeserializer
      Accessor for object that handles conversions between types and matching type ids.
      Specified by:
      getTypeIdResolver in class TypeDeserializer
    • getDefaultImpl

      public Class<?> getDefaultImpl()
      Description copied from class: TypeDeserializer
      Accessor for "default implementation" type; optionally defined class to use in cases where type id is not accessible for some reason (either missing, or cannot be resolved)
      Specified by:
      getDefaultImpl in class TypeDeserializer
    • deserializeTypedFromObject

      public Object deserializeTypedFromObject(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException
      Description copied from class: TypeDeserializer
      Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Object (regardless of Java type). Method needs to figure out intended polymorphic type, locate ValueDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).
      Specified by:
      deserializeTypedFromObject in class TypeDeserializer
      Throws:
      tools.jackson.core.JacksonException
    • deserializeTypedFromArray

      public Object deserializeTypedFromArray(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException
      Description copied from class: TypeDeserializer
      Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as JSON Array (regardless of Java type). Method needs to figure out intended polymorphic type, locate ValueDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).
      Specified by:
      deserializeTypedFromArray in class TypeDeserializer
      Throws:
      tools.jackson.core.JacksonException
    • deserializeTypedFromScalar

      public Object deserializeTypedFromScalar(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException
      Description copied from class: TypeDeserializer
      Method called to let this type deserializer handle deserialization of "typed" object, when value itself is serialized as a scalar JSON value (something other than Array or Object), regardless of Java type. Method needs to figure out intended polymorphic type, locate ValueDeserializer to use, and call it with JSON data to deserializer (which does not contain type information).
      Specified by:
      deserializeTypedFromScalar in class TypeDeserializer
      Throws:
      tools.jackson.core.JacksonException
    • deserializeTypedFromAny

      public Object deserializeTypedFromAny(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException
      Description copied from class: TypeDeserializer
      Method called to let this type deserializer handle deserialization of "typed" object, when value itself may have been serialized using any kind of JSON value (Array, Object, scalar). Should only be called if JSON serialization is polymorphic (not Java type); for example when using JSON node representation, or "untyped" Java object (which may be Map, Collection, wrapper/primitive etc).
      Specified by:
      deserializeTypedFromAny in class TypeDeserializer
      Throws:
      tools.jackson.core.JacksonException
    • _deserialize

      protected Object _deserialize(tools.jackson.core.JsonParser p, DeserializationContext ctxt) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException