Class DefaultJackson2JavaTypeMapper

java.lang.Object
org.springframework.kafka.support.mapping.AbstractJavaTypeMapper
org.springframework.kafka.support.mapping.DefaultJackson2JavaTypeMapper
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, ClassMapper, Jackson2JavaTypeMapper

@Deprecated(forRemoval=true, since="4.0") public class DefaultJackson2JavaTypeMapper extends AbstractJavaTypeMapper implements Jackson2JavaTypeMapper
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.0 in favor of DefaultJacksonJavaTypeMapper for Jackson 3.
Jackson 2 type mapper.
Since:
2.1
  • Constructor Details

    • DefaultJackson2JavaTypeMapper

      public DefaultJackson2JavaTypeMapper()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getTypePrecedence

      public Jackson2JavaTypeMapper.TypePrecedence getTypePrecedence()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the precedence.
      Specified by:
      getTypePrecedence in interface Jackson2JavaTypeMapper
      Returns:
      the precedence.
      See Also:
    • setTypePrecedence

      public void setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence typePrecedence)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Set the precedence for evaluating type information in message properties. When using @KafkaListener at the method level, the framework attempts to determine the target type for payload conversion from the method signature. If so, this type is provided by the MessagingMessageListenerAdapter.

      By default, if the type is concrete (not abstract, not an interface), this will be used ahead of type information provided in the __TypeId__ and associated headers provided by the sender.

      If you wish to force the use of the __TypeId__ and associated headers (such as when the actual type is a subclass of the method argument type), set the precedence to Jackson2JavaTypeMapper.TypePrecedence.TYPE_ID.

      Specified by:
      setTypePrecedence in interface Jackson2JavaTypeMapper
      Parameters:
      typePrecedence - the precedence.
    • addTrustedPackages

      public void addTrustedPackages(String... packagesToTrust)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specify a set of packages to trust during deserialization. The asterisk (*) means trust all.
      Specified by:
      addTrustedPackages in interface Jackson2JavaTypeMapper
      Parameters:
      packagesToTrust - the trusted Java packages for deserialization
    • toJavaType

      public @Nullable com.fasterxml.jackson.databind.JavaType toJavaType(org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      toJavaType in interface Jackson2JavaTypeMapper
    • fromJavaType

      public void fromJavaType(com.fasterxml.jackson.databind.JavaType javaType, org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      fromJavaType in interface Jackson2JavaTypeMapper
    • fromClass

      public void fromClass(Class<?> clazz, org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      fromClass in interface ClassMapper
    • toClass

      public @Nullable Class<?> toClass(org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      toClass in interface ClassMapper
    • removeHeaders

      public void removeHeaders(org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Remove the type information headers.
      Specified by:
      removeHeaders in interface Jackson2JavaTypeMapper
      Parameters:
      headers - the headers.