Class JsonDeserializer<T>

java.lang.Object
org.springframework.kafka.support.serializer.JsonDeserializer<T>
Type Parameters:
T - class of the entity, representing messages
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.common.serialization.Deserializer<T>

@Deprecated(forRemoval=true, since="4.0") public class JsonDeserializer<T> extends Object implements org.apache.kafka.common.serialization.Deserializer<T>
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.0 in favor of JacksonJsonDeserializer for Jackson 3.
Generic Deserializer for receiving JSON from Kafka and return Java objects.

IMPORTANT: Configuration must be done completely with property setters or via configure(Map, boolean), not a mixture. If any setters have been called, configure(Map, boolean) will be a no-op.

Author:
Igor Stepanov, Artem Bilan, Gary Russell, Yanming Zhou, Elliot Kennedy, Torsten Schleede, Ivan Ponomarev, Omer Celik
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property for the default key type if no header.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    A method name to determine the JavaType to deserialize the key to: 'com.Foo.deserialize'.
    protected final com.fasterxml.jackson.databind.ObjectMapper
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property for removing type headers (default true).
    protected @Nullable com.fasterxml.jackson.databind.JavaType
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property for trusted deserialization packages.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property to add type mappings to the type mapper: 'foo=com.Foo,bar=com.Bar'.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property for using type headers (default true).
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Kafka config property for the default value type if no header.
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    A method name to determine the JavaType to deserialize the value to: 'com.Foo.deserialize'.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with a default ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and a default ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
    JsonDeserializer(com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and a default ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and ObjectMapper.
    JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
    JsonDeserializer(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided ObjectMapper.
    JsonDeserializer(@Nullable Class<? super T> targetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and a default ObjectMapper.
    JsonDeserializer(@Nullable Class<? super T> targetType, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
    JsonDeserializer(@Nullable Class<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
    JsonDeserializer(Class<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct an instance with the provided target type, and ObjectMapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add trusted packages for deserialization.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    configure(Map<String,?> configs, boolean isKey)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    copyWithType(com.fasterxml.jackson.core.type.TypeReference<? super X> newTargetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Copies this deserializer with same configuration, except new target type reference is used.
    copyWithType(com.fasterxml.jackson.databind.JavaType newTargetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Copies this deserializer with same configuration, except new target java type is used.
    copyWithType(Class<? super X> newTargetType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Copies this deserializer with same configuration, except new target type is used.
    @Nullable T
    deserialize(String topic, byte[] data)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    @Nullable T
    deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Don't remove type information headers.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Designate this deserializer for deserializing keys (default is values); only applies if the default type mapper is used.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Ignore type information headers and use the configured target class.
    void
    setRemoveTypeHeaders(boolean removeTypeHeaders)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set to false to retain type information headers after deserialization.
    void
    setTypeFunction(BiFunction<byte[], org.apache.kafka.common.header.Headers, com.fasterxml.jackson.databind.JavaType> typeFunction)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set a BiFunction that receives the data to be deserialized and the headers and returns a JavaType.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set a customized type mapper.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set a JsonTypeResolver that receives the data to be deserialized and the headers and returns a JavaType.
    void
    setUseTypeHeaders(boolean useTypeHeaders)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set to false to ignore type information in headers and use the configured target type instead.
    void
    setUseTypeMapperForKey(boolean isKey)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure the default Jackson2JavaTypeMapper to use key type headers.
    trustedPackages(String... packages)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add trusted packages to the default type mapper.
    typeFunction(BiFunction<byte[], org.apache.kafka.common.header.Headers, com.fasterxml.jackson.databind.JavaType> typeFunction)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set a BiFunction that receives the data to be deserialized and the headers and returns a JavaType.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use the supplied Jackson2JavaTypeMapper.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set a JsonTypeResolver that receives the data to be deserialized and the headers and returns a JavaType.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.kafka.common.serialization.Deserializer

    deserialize
  • Field Details

    • KEY_DEFAULT_TYPE

      public static final String KEY_DEFAULT_TYPE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property for the default key type if no header.
      See Also:
    • VALUE_DEFAULT_TYPE

      public static final String VALUE_DEFAULT_TYPE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property for the default value type if no header.
      See Also:
    • TRUSTED_PACKAGES

      public static final String TRUSTED_PACKAGES
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property for trusted deserialization packages.
      See Also:
    • TYPE_MAPPINGS

      public static final String TYPE_MAPPINGS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property to add type mappings to the type mapper: 'foo=com.Foo,bar=com.Bar'.
      See Also:
    • REMOVE_TYPE_INFO_HEADERS

      public static final String REMOVE_TYPE_INFO_HEADERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property for removing type headers (default true).
      See Also:
    • USE_TYPE_INFO_HEADERS

      public static final String USE_TYPE_INFO_HEADERS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Kafka config property for using type headers (default true).
      Since:
      2.2.3
      See Also:
    • KEY_TYPE_METHOD

      public static final String KEY_TYPE_METHOD
      Deprecated, for removal: This API element is subject to removal in a future version.
      A method name to determine the JavaType to deserialize the key to: 'com.Foo.deserialize'. See JsonTypeResolver.resolveType(java.lang.String, byte[], org.apache.kafka.common.header.Headers) for the signature.
      See Also:
    • VALUE_TYPE_METHOD

      public static final String VALUE_TYPE_METHOD
      Deprecated, for removal: This API element is subject to removal in a future version.
      A method name to determine the JavaType to deserialize the value to: 'com.Foo.deserialize'. See JsonTypeResolver.resolveType(java.lang.String, byte[], org.apache.kafka.common.header.Headers) for the signature.
      See Also:
    • objectMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
      Deprecated, for removal: This API element is subject to removal in a future version.
    • targetType

      protected @Nullable com.fasterxml.jackson.databind.JavaType targetType
      Deprecated, for removal: This API element is subject to removal in a future version.
    • typeMapper

      protected Jackson2JavaTypeMapper typeMapper
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • JsonDeserializer

      public JsonDeserializer()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with a default ObjectMapper.
    • JsonDeserializer

      public JsonDeserializer(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided ObjectMapper.
      Parameters:
      objectMapper - a custom object mapper.
    • JsonDeserializer

      public JsonDeserializer(@Nullable Class<? super T> targetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and a default ObjectMapper.
      Parameters:
      targetType - the target type to use if no type info headers are present.
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and a default ObjectMapper.
      Parameters:
      targetType - the target type reference to use if no type info headers are present.
      Since:
      2.3
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and a default ObjectMapper.
      Parameters:
      targetType - the target java type to use if no type info headers are present.
      Since:
      2.3
    • JsonDeserializer

      public JsonDeserializer(@Nullable Class<? super T> targetType, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
      Parameters:
      targetType - the target type.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.2
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
      Parameters:
      targetType - the target type reference.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.3
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and useHeadersIfPresent with a default ObjectMapper.
      Parameters:
      targetType - the target java type.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.3
    • JsonDeserializer

      public JsonDeserializer(Class<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and ObjectMapper.
      Parameters:
      targetType - the target type to use if no type info headers are present.
      objectMapper - the mapper. type if not.
    • JsonDeserializer

      public JsonDeserializer(com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and ObjectMapper.
      Parameters:
      targetType - the target type reference to use if no type info headers are present.
      objectMapper - the mapper. type if not.
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, and ObjectMapper.
      Parameters:
      targetType - the target java type to use if no type info headers are present.
      objectMapper - the mapper. type if not.
    • JsonDeserializer

      public JsonDeserializer(@Nullable Class<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
      Parameters:
      targetType - the target type.
      objectMapper - the mapper.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.2
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.core.type.TypeReference<? super T> targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
      Parameters:
      targetType - the target type reference.
      objectMapper - the mapper.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.3
    • JsonDeserializer

      public JsonDeserializer(@Nullable com.fasterxml.jackson.databind.JavaType targetType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean useHeadersIfPresent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct an instance with the provided target type, ObjectMapper and useHeadersIfPresent.
      Parameters:
      targetType - the target type reference.
      objectMapper - the mapper.
      useHeadersIfPresent - true to use headers if present and fall back to target type if not.
      Since:
      2.3
  • Method Details

    • getTypeMapper

      public Jackson2JavaTypeMapper getTypeMapper()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setTypeMapper

      public void setTypeMapper(Jackson2JavaTypeMapper typeMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a customized type mapper. If the mapper is an AbstractJavaTypeMapper, any class mappings configured in the mapper will be added to the trusted packages.
      Parameters:
      typeMapper - the type mapper.
      Since:
      2.1
    • setUseTypeMapperForKey

      public void setUseTypeMapperForKey(boolean isKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure the default Jackson2JavaTypeMapper to use key type headers.
      Parameters:
      isKey - Use key type headers if true
      Since:
      2.1.3
    • setRemoveTypeHeaders

      public void setRemoveTypeHeaders(boolean removeTypeHeaders)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set to false to retain type information headers after deserialization. Default true.
      Parameters:
      removeTypeHeaders - true to remove headers.
      Since:
      2.2
    • setUseTypeHeaders

      public void setUseTypeHeaders(boolean useTypeHeaders)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set to false to ignore type information in headers and use the configured target type instead. Only applies if the preconfigured type mapper is used. Default true.
      Parameters:
      useTypeHeaders - false to ignore type headers.
      Since:
      2.2.8
    • setTypeFunction

      public void setTypeFunction(BiFunction<byte[], org.apache.kafka.common.header.Headers, com.fasterxml.jackson.databind.JavaType> typeFunction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a BiFunction that receives the data to be deserialized and the headers and returns a JavaType.
      Parameters:
      typeFunction - the function.
      Since:
      2.5
    • setTypeResolver

      public void setTypeResolver(JsonTypeResolver typeResolver)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a JsonTypeResolver that receives the data to be deserialized and the headers and returns a JavaType.
      Parameters:
      typeResolver - the resolver.
      Since:
      2.5.3
    • configure

      public void configure(Map<String,?> configs, boolean isKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      configure in interface org.apache.kafka.common.serialization.Deserializer<T>
    • addTrustedPackages

      public void addTrustedPackages(String... packages)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add trusted packages for deserialization.
      Parameters:
      packages - the packages.
      Since:
      2.1
    • deserialize

      public @Nullable T deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deserialize in interface org.apache.kafka.common.serialization.Deserializer<T>
    • deserialize

      public @Nullable T deserialize(String topic, byte[] data)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deserialize in interface org.apache.kafka.common.serialization.Deserializer<T>
    • close

      public void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.kafka.common.serialization.Deserializer<T>
    • copyWithType

      public <X> JsonDeserializer<X> copyWithType(Class<? super X> newTargetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies this deserializer with same configuration, except new target type is used.
      Type Parameters:
      X - new deserialization result type
      Parameters:
      newTargetType - type used for when type headers are missing, not null
      Returns:
      new instance of deserializer with type changes
      Since:
      2.6
    • copyWithType

      public <X> JsonDeserializer<X> copyWithType(com.fasterxml.jackson.core.type.TypeReference<? super X> newTargetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies this deserializer with same configuration, except new target type reference is used.
      Type Parameters:
      X - new deserialization result type
      Parameters:
      newTargetType - type reference used for when type headers are missing, not null
      Returns:
      new instance of deserializer with type changes
      Since:
      2.6
    • copyWithType

      public <X> JsonDeserializer<X> copyWithType(com.fasterxml.jackson.databind.JavaType newTargetType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copies this deserializer with same configuration, except new target java type is used.
      Type Parameters:
      X - new deserialization result type
      Parameters:
      newTargetType - java type used for when type headers are missing, not null
      Returns:
      new instance of deserializer with type changes
      Since:
      2.6
    • forKeys

      public JsonDeserializer<T> forKeys()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Designate this deserializer for deserializing keys (default is values); only applies if the default type mapper is used.
      Returns:
      the deserializer.
      Since:
      2.3
    • dontRemoveTypeHeaders

      public JsonDeserializer<T> dontRemoveTypeHeaders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't remove type information headers.
      Returns:
      the deserializer.
      Since:
      2.3
      See Also:
    • ignoreTypeHeaders

      public JsonDeserializer<T> ignoreTypeHeaders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Ignore type information headers and use the configured target class.
      Returns:
      the deserializer.
      Since:
      2.3
      See Also:
    • typeMapper

      public JsonDeserializer<T> typeMapper(Jackson2JavaTypeMapper mapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use the supplied Jackson2JavaTypeMapper.
      Parameters:
      mapper - the mapper.
      Returns:
      the deserializer.
      Since:
      2.3
      See Also:
    • trustedPackages

      public JsonDeserializer<T> trustedPackages(String... packages)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add trusted packages to the default type mapper.
      Parameters:
      packages - the packages.
      Returns:
      the deserializer.
      Since:
      2, 5
    • typeFunction

      public JsonDeserializer<T> typeFunction(BiFunction<byte[], org.apache.kafka.common.header.Headers, com.fasterxml.jackson.databind.JavaType> typeFunction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a BiFunction that receives the data to be deserialized and the headers and returns a JavaType.
      Parameters:
      typeFunction - the function.
      Returns:
      the deserializer.
      Since:
      2.5
    • typeResolver

      public JsonDeserializer<T> typeResolver(JsonTypeResolver resolver)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a JsonTypeResolver that receives the data to be deserialized and the headers and returns a JavaType.
      Parameters:
      resolver - the resolver.
      Returns:
      the deserializer.
      Since:
      2.5.3