Class DefaultJackson2JavaTypeMapper

    • Constructor Detail

      • DefaultJackson2JavaTypeMapper

        public DefaultJackson2JavaTypeMapper()
    • Method Detail

      • setTypePrecedence

        public void setTypePrecedence​(Jackson2JavaTypeMapper.TypePrecedence typePrecedence)
        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​(@Nullable
                                       java.lang.String... trustedPackages)
        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
      • getInferredType

        @Nullable
        public com.fasterxml.jackson.databind.JavaType getInferredType​(MessageProperties properties)
        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.