Class Jackson2JsonEncoder
java.lang.Object
org.springframework.http.codec.json.Jackson2CodecSupport
org.springframework.http.codec.json.AbstractJackson2Encoder
org.springframework.http.codec.json.Jackson2JsonEncoder
- All Implemented Interfaces:
Encoder<Object>
,HttpMessageEncoder<Object>
Encode from an
Object
stream to a byte stream of JSON objects using Jackson 2.9.
For non-streaming use cases, Flux
elements are collected into a List
before serialization for performance reason.- Since:
- 5.0
- Author:
- Sebastien Deleuze, Arjen Poutsma
- See Also:
-
Field Summary
Fields inherited from class org.springframework.http.codec.json.Jackson2CodecSupport
JSON_VIEW_HINT, logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectWriter
customizeWriter
(ObjectWriter writer, MimeType mimeType, ResolvableType elementType, Map<String, Object> hints) Methods inherited from class org.springframework.http.codec.json.AbstractJackson2Encoder
canEncode, encode, encodeValue, getAnnotation, getEncodableMimeTypes, getEncodableMimeTypes, getEncodeHints, getJsonEncoding, getStreamingMediaTypes, getStreamingMediaTypeSeparator, setStreamingMediaTypes
Methods inherited from class org.springframework.http.codec.json.Jackson2CodecSupport
getHints, getJavaType, getMimeTypes, getMimeTypes, getObjectMapper, getObjectMapperRegistrations, getObjectMappersForType, getParameter, logWarningIfNecessary, registerObjectMappersForType, selectObjectMapper, setObjectMapper, supportsMimeType
-
Constructor Details
-
Jackson2JsonEncoder
public Jackson2JsonEncoder() -
Jackson2JsonEncoder
-
-
Method Details
-
customizeWriter
protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType, ResolvableType elementType, @Nullable Map<String, Object> hints) - Overrides:
customizeWriter
in classAbstractJackson2Encoder
-