Class JacksonJsonMessageConverter

All Implemented Interfaces:
MessageConverter, SmartMessageConverter, Aware, BeanClassLoaderAware

public class JacksonJsonMessageConverter extends AbstractJacksonMessageConverter
JSON converter that uses the Jackson 3.
Since:
4.0
Author:
Artem Bilan
  • Constructor Details

    • JacksonJsonMessageConverter

      public JacksonJsonMessageConverter()
      Construct with an internal JsonMapper instance and trusted packed to all (*).
    • JacksonJsonMessageConverter

      public JacksonJsonMessageConverter(String... trustedPackages)
      Construct with an internal JsonMapper instance. The DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES and MapperFeature.DEFAULT_VIEW_INCLUSION are set to false on the JsonMapper.
      Parameters:
      trustedPackages - the trusted Java packages for deserialization
      See Also:
    • JacksonJsonMessageConverter

      public JacksonJsonMessageConverter(tools.jackson.databind.json.JsonMapper jsonMapper)
      Construct with the provided JsonMapper instance and trusted packed to all (*).
      Parameters:
      jsonMapper - the JsonMapper to use.
    • JacksonJsonMessageConverter

      public JacksonJsonMessageConverter(tools.jackson.databind.json.JsonMapper jsonMapper, String... trustedPackages)
      Construct with the provided JsonMapper instance.
      Parameters:
      jsonMapper - the JsonMapper to use.
      trustedPackages - the trusted Java packages for deserialization
      See Also:
  • Method Details

    • setUseProjectionForInterfaces

      public void setUseProjectionForInterfaces(boolean useProjectionForInterfaces)
      Set to true to use Spring Data projection to create the object if the inferred parameter type is an interface.
      Parameters:
      useProjectionForInterfaces - true to use projection.
    • isUseProjectionForInterfaces

      protected boolean isUseProjectionForInterfaces()
    • convertContent

      protected Object convertContent(Message message, @Nullable Object conversionHint, MessageProperties properties, @Nullable String encoding) throws IOException
      Overrides:
      convertContent in class AbstractJacksonMessageConverter
      Throws:
      IOException