Class DefaultJackson2JavaTypeMapper

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

@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.
  • 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.
      Since:
      1.6.
      See Also:
    • setTypePrecedence

      public 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 @RabbitListener 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 in the inferredArgumentType message property.

      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:
      1.6
    • setTrustedPackages

      public void setTrustedPackages(String @Nullable ... trustedPackages)
      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.
      Parameters:
      trustedPackages - the trusted Java packages for deserialization
      Since:
      1.6.11
    • addTrustedPackages

      public void addTrustedPackages(String @Nullable ... packages)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Add trusted packages.
      Specified by:
      addTrustedPackages in interface Jackson2JavaTypeMapper
      Parameters:
      packages - the packages.
    • toJavaType

      public com.fasterxml.jackson.databind.JavaType toJavaType(MessageProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Determine the type from the message properties.
      Specified by:
      toJavaType in interface Jackson2JavaTypeMapper
      Parameters:
      properties - the properties.
      Returns:
      the type.
    • getInferredType

      public @Nullable com.fasterxml.jackson.databind.JavaType getInferredType(MessageProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Return the inferred type, if the type precedence is inferred and the header is present.
      Specified by:
      getInferredType in interface Jackson2JavaTypeMapper
      Parameters:
      properties - the message properties.
      Returns:
      the type.
    • fromJavaType

      public void fromJavaType(com.fasterxml.jackson.databind.JavaType javaType, MessageProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Jackson2JavaTypeMapper
      Set the message properties according to the type.
      Specified by:
      fromJavaType in interface Jackson2JavaTypeMapper
      Parameters:
      javaType - the type.
      properties - the properties.
    • fromClass

      public void fromClass(Class<?> clazz, MessageProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      fromClass in interface ClassMapper
    • toClass

      public Class<?> toClass(MessageProperties properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      toClass in interface ClassMapper