类 Jackson2CborEncoder
- java.lang.Object
- org.springframework.http.codec.json.Jackson2CodecSupport
- org.springframework.http.codec.json.AbstractJackson2Encoder
- org.springframework.http.codec.cbor.Jackson2CborEncoder
- 所有已实现的接口:
Encoder<Object>
,HttpMessageEncoder<Object>
public class Jackson2CborEncoder extends AbstractJackson2Encoder
Encode from anObject
to bytes of CBOR objects using Jackson. Stream encoding is not supported yet.- 从以下版本开始:
- 5.2
- 作者:
- Sebastien Deleuze
- 另请参阅:
Jackson2CborDecoder
, Add CBOR support to WebFlux
字段概要
从类继承的字段 org.springframework.http.codec.json.Jackson2CodecSupport
JSON_VIEW_HINT, logger
构造器概要
构造器 构造器 说明 Jackson2CborEncoder()
Jackson2CborEncoder(ObjectMapper mapper, MimeType... mimeTypes)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 reactor.core.publisher.Flux<DataBuffer>
encode(org.reactivestreams.Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
Encode a stream of Objects of typeT
into aDataBuffer
output stream.从类继承的方法 org.springframework.http.codec.json.AbstractJackson2Encoder
canEncode, customizeWriter, encodeValue, getAnnotation, getEncodableMimeTypes, getEncodeHints, getJsonEncoding, getStreamingMediaTypes, setStreamingMediaTypes
从类继承的方法 org.springframework.http.codec.json.Jackson2CodecSupport
getHints, getJavaType, getMimeTypes, getObjectMapper, getParameter, supportsMimeType
构造器详细资料
Jackson2CborEncoder
public Jackson2CborEncoder()
Jackson2CborEncoder
public Jackson2CborEncoder(ObjectMapper mapper, MimeType... mimeTypes)
方法详细资料
encode
public reactor.core.publisher.Flux<DataBuffer> encode(org.reactivestreams.Publisher<?> inputStream, DataBufferFactory bufferFactory, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)
从接口复制的说明:Encoder
Encode a stream of Objects of typeT
into aDataBuffer
output stream.- 指定者:
encode
在接口中Encoder<Object>
- 覆盖:
encode
在类中AbstractJackson2Encoder
- 参数:
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 ofMono
should be used.bufferFactory
- for creating output streamDataBuffer
'selementType
- the expected type of elements in the input stream; this type must have been previously passed to theEncoder.canEncode(org.springframework.core.ResolvableType, org.springframework.util.MimeType)
method and it must have returnedtrue
.mimeType
- the MIME type for the output content (optional)hints
- additional information about how to encode- 返回:
- the output stream