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:
- 
Field SummaryFields inherited from class JacksonCodecSupportFILTER_PROVIDER_HINT, JSON_VIEW_HINT, logger, mapperRegistrations
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a new instance with aCBORMappercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader).JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper mapper) Construct a new instance with the providedCBORMapper.JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper.Builder builder) Construct a new instance with the providedCBORMapper.Buildercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader).JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper.Builder builder, MimeType... mimeTypes) Construct a new instance with the providedCBORMapper.Buildercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader), andMimeTypes.JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper mapper, MimeType... mimeTypes) Construct a new instance with the providedCBORMapperandMimeTypes.
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Flux<DataBuffer> encode(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Encode a stream of Objects of typeTinto aDataBufferoutput stream.Methods inherited from class AbstractJacksonEncodercanEncode, customizeWriter, encodeValue, getAnnotation, getEncodableMimeTypes, getEncodableMimeTypes, getEncodeHints, getJsonEncoding, getStreamingMediaTypes, getStreamingMediaTypeSeparator, setStreamingMediaTypesMethods inherited from class JacksonCodecSupportgetHints, getJavaType, getMapper, getMapperRegistrations, getMappersForType, getMediaTypesForProblemDetail, getMimeTypes, getMimeTypes, getParameter, registerMappersForType, selectMapper, supportsMimeType
- 
Constructor Details- 
JacksonCborEncoderpublic JacksonCborEncoder()Construct a new instance with aCBORMappercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader).
- 
JacksonCborEncoderpublic JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper.Builder builder) Construct a new instance with the providedCBORMapper.Buildercustomized with theJacksonModules found byMapperBuilder.findModules(ClassLoader).- See Also:
 
- 
JacksonCborEncoderpublic JacksonCborEncoder(tools.jackson.dataformat.cbor.CBORMapper mapper) Construct a new instance with the providedCBORMapper.- See Also:
 
- 
JacksonCborEncoder
- 
JacksonCborEncoder
 
- 
- 
Method Details- 
encodepublic reactor.core.publisher.Flux<DataBuffer> encode(Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Description copied from interface:EncoderEncode a stream of Objects of typeTinto aDataBufferoutput stream.- Specified by:
- encodein interface- Encoder<Object>
- Overrides:
- encodein class- 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- Monoshould 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
 
 
-