Class JacksonJsonDecoder

java.lang.Object
org.springframework.http.codec.JacksonCodecSupport<tools.jackson.databind.json.JsonMapper>
org.springframework.http.codec.AbstractJacksonDecoder<tools.jackson.databind.json.JsonMapper>
org.springframework.http.codec.json.JacksonJsonDecoder
All Implemented Interfaces:
org.springframework.core.codec.Decoder<Object>, HttpMessageDecoder<Object>

public class JacksonJsonDecoder extends AbstractJacksonDecoder<tools.jackson.databind.json.JsonMapper>
Decode a byte stream into JSON and convert to Object's with Jackson 3.x leveraging non-blocking parsing.
Since:
7.0
Author:
Sebastien Deleuze
See Also:
  • Constructor Details

    • JacksonJsonDecoder

      public JacksonJsonDecoder()
      Construct a new instance with a JsonMapper customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
    • JacksonJsonDecoder

      public JacksonJsonDecoder(tools.jackson.databind.json.JsonMapper.Builder builder)
      Construct a new instance with the provided JsonMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
      See Also:
      • JsonMapper.builder()
    • JacksonJsonDecoder

      public JacksonJsonDecoder(tools.jackson.databind.json.JsonMapper mapper)
      Construct a new instance with the provided JsonMapper.
      See Also:
      • JsonMapper.builder()
    • JacksonJsonDecoder

      public JacksonJsonDecoder(tools.jackson.databind.json.JsonMapper.Builder builder, org.springframework.util.MimeType... mimeTypes)
      Construct a new instance with the provided JsonMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader), and MimeTypes.
      See Also:
      • JsonMapper.builder()
    • JacksonJsonDecoder

      public JacksonJsonDecoder(tools.jackson.databind.json.JsonMapper mapper, org.springframework.util.MimeType... mimeTypes)
      Construct a new instance with the provided JsonMapper and MimeTypes.
  • Method Details

    • canDecode

      public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType)
      Specified by:
      canDecode in interface org.springframework.core.codec.Decoder<Object>
      Overrides:
      canDecode in class AbstractJacksonDecoder<tools.jackson.databind.json.JsonMapper>
    • processInput

      protected reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> processInput(Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Description copied from class: AbstractJacksonDecoder
      Process the input publisher into a flux. Default implementation returns Flux.from(Publisher), but subclasses can choose to customize this behavior.
      Overrides:
      processInput in class AbstractJacksonDecoder<tools.jackson.databind.json.JsonMapper>
      Parameters:
      input - the DataBuffer input stream to process
      elementType - the expected type of elements in the output stream
      mimeType - the MIME type associated with the input stream (optional)
      hints - additional information about how to do encode
      Returns:
      the processed flux