Class JacksonCborEncoder

java.lang.Object
org.springframework.http.codec.JacksonCodecsupport<tools.jackson.dataformat.cbor.CBORMapper>
org.springframework.http.codec.AbstractJacksonEncoder<tools.jackson.dataformat.cbor.CBORMapper>
org.springframework.http.codec.cbor.JacksonCborEncoder
All Implemented Interfaces:
Encoder<Object>, HttpMessageEncoder<Object>

public class JacksonCborEncoder extends AbstractJacksonEncoder<tools.jackson.dataformat.cbor.CBORMapper>
Encode from an Object to bytes of CBOR objects using Jackson 3.x.

stream encoding is currently not supported.

since:
7.0
Author:
sebastien Deleuze
see Also:
  • Constructor Details

    • JacksonCborEncoder

      public&nbsp;JacksonCborEncoder()
      Construct a new instance with a CBORMapper customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
    • JacksonCborEncoder

      public&nbsp;JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper.Builder&nbsp;builder)
      Construct a new instance with the provided CBORMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
      see Also:
      • CBORMapper.builder()
    • JacksonCborEncoder

      public&nbsp;JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper&nbsp;mapper)
      Construct a new instance with the provided CBORMapper.
      see Also:
      • CBORMapper.builder()
    • JacksonCborEncoder

      public&nbsp;JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper.Builder&nbsp;builder, MimeType...&nbsp;mimeTypes)
      Construct a new instance with the provided CBORMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader), and MimeTypes.
      see Also:
      • CBORMapper.builder()
    • JacksonCborEncoder

      public&nbsp;JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper&nbsp;mapper, MimeType...&nbsp;mimeTypes)
      Construct a new instance with the provided CBORMapper and MimeTypes.
      see Also:
      • CBORMapper.builder()
  • Method Details

    • encode

      public&nbsp;reactor.core.publisher.Flux<DataBuffer>&nbsp;encode(Publisher<?>&nbsp;inputstream, DataBufferFactory&nbsp;bufferFactory, ResolvableType&nbsp;elementType, @Nullable MimeType&nbsp;mimeType, @Nullable Map<string,Object>&nbsp;hints)
      Description copied from interface:&nbsp;Encoder
      Encode a stream of Objects of type T into a DataBuffer output stream.
      specified by:
      encode&nbsp;in interface&nbsp;Encoder<Object>
      Overrides:
      encode&nbsp;in class&nbsp;AbstractJacksonEncoder<tools.jackson.dataformat.cbor.CBORMapper>
      Parameters:
      inputstream - the input stream of Objects to encode. If the input should be encoded as a single value rather than as a stream of elements, an instance of Mono should be used.
      bufferFactory - for creating output stream DataBuffer's
      elementType - the expected type of elements in the input stream; this type must have been previously passed to the Encoder.canEncode(ResolvableType, MimeType) method and it must have returned true.
      mimeType - the MIME type for the output content (optional)
      hints - additional information about how to encode
      Returns:
      the output stream