public class Jackson2JsonEncoder extends AbstractJackson2Encoder
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.Jackson2JsonDecoder
Modifier and Type | Field and Description |
---|---|
private PrettyPrinter |
ssePrettyPrinter |
streamingMediaTypes
JSON_VIEW_HINT
Constructor and Description |
---|
Jackson2JsonEncoder() |
Jackson2JsonEncoder(ObjectMapper mapper,
MimeType... mimeTypes) |
Modifier and Type | Method and Description |
---|---|
protected ObjectWriter |
customizeWriter(ObjectWriter writer,
MimeType mimeType,
ResolvableType elementType,
java.util.Map<java.lang.String,java.lang.Object> hints) |
java.util.List<MimeType> |
getEncodableMimeTypes()
Return the list of mime types this encoder supports.
|
private static PrettyPrinter |
initSsePrettyPrinter() |
canEncode, encode, getAnnotation, getEncodeHints, getStreamingMediaTypes, setStreamingMediaTypes
getHints, getJavaType, getMimeTypes, getObjectMapper, getParameter, supportsMimeType
@Nullable private final PrettyPrinter ssePrettyPrinter
public Jackson2JsonEncoder()
public Jackson2JsonEncoder(ObjectMapper mapper, MimeType... mimeTypes)
private static PrettyPrinter initSsePrettyPrinter()
protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType, ResolvableType elementType, @Nullable java.util.Map<java.lang.String,java.lang.Object> hints)
customizeWriter
in class AbstractJackson2Encoder