Interface Jackson2JavaTypeMapper

All Superinterfaces:
ClassMapper
All Known Implementing Classes:
DefaultJackson2JavaTypeMapper

@Deprecated(forRemoval=true, since="4.0") public interface Jackson2JavaTypeMapper extends ClassMapper
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.0 in favor of JacksonJavaTypeMapper for Jackson 3.
Strategy for setting metadata on messages such that one can create the class that needs to be instantiated when receiving a message.
Since:
2.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Deprecated, for removal: This API element is subject to removal in a future version.
    The precedence for type conversion - inferred from the method parameter or message headers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    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.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default void
    removeHeaders(org.apache.kafka.common.header.Headers headers)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove the type information headers.
    default void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set the precedence for evaluating type information in message properties.
    @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.
     

    Methods inherited from interface ClassMapper

    fromClass, toClass
  • Method Details

    • fromJavaType

      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.
    • toJavaType

      @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.
    • getTypePrecedence

      Deprecated, for removal: This API element is subject to removal in a future version.
    • setTypePrecedence

      default void setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence typePrecedence)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.

      Parameters:
      typePrecedence - the precedence.
      Since:
      2.2
    • addTrustedPackages

      void addTrustedPackages(String... packages)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • removeHeaders

      default void removeHeaders(org.apache.kafka.common.header.Headers headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the type information headers.
      Parameters:
      headers - the headers.
      Since:
      2.2