Class JacksonJsonDecoder
java.lang.Object
org.springframework.http.codec.JacksonCodecSupport
org.springframework.http.codec.AbstractJacksonDecoder
org.springframework.http.codec.json.JacksonJsonDecoder
- All Implemented Interfaces:
Decoder<Object>
,HttpMessageDecoder<Object>
Decode a byte stream into JSON and convert to Object's with
Jackson 3.x
leveraging non-blocking parsing.
The default constructor loads JacksonModule
s
found by MapperBuilder.findModules(ClassLoader)
.
- Since:
- 7.0
- Author:
- Sebastien Deleuze
- See Also:
-
Field Summary
Fields inherited from class org.springframework.http.codec.JacksonCodecSupport
FILTER_PROVIDER_HINT, JSON_VIEW_HINT, logger, objectMapperRegistrations
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance with aJsonMapper
customized with theJacksonModule
s found byMapperBuilder.findModules(ClassLoader)
.JacksonJsonDecoder
(ObjectMapper mapper) Construct a new instance with the providedObjectMapper
.JacksonJsonDecoder
(ObjectMapper mapper, MimeType... mimeTypes) Construct a new instance with the providedObjectMapper
andMimeType
s. -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Flux
<DataBuffer> processInput
(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Process the input publisher into a flux.Methods inherited from class org.springframework.http.codec.AbstractJacksonDecoder
canDecode, customizeReader, decode, decode, decodeToMono, getAnnotation, getDecodableMimeTypes, getDecodableMimeTypes, getDecodeHints, getMaxInMemorySize, setMaxInMemorySize
Methods inherited from class org.springframework.http.codec.JacksonCodecSupport
getHints, getJavaType, getMediaTypesForProblemDetail, getMimeTypes, getMimeTypes, getObjectMapper, getObjectMapperRegistrations, getObjectMappersForType, getParameter, registerObjectMappersForType, selectObjectMapper, supportsMimeType
-
Constructor Details
-
JacksonJsonDecoder
public JacksonJsonDecoder()Construct a new instance with aJsonMapper
customized with theJacksonModule
s found byMapperBuilder.findModules(ClassLoader)
. -
JacksonJsonDecoder
Construct a new instance with the providedObjectMapper
.- See Also:
-
JacksonJsonDecoder
Construct a new instance with the providedObjectMapper
andMimeType
s.- See Also:
-
-
Method Details
-
processInput
protected reactor.core.publisher.Flux<DataBuffer> processInput(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String, Object> hints) Description copied from class:AbstractJacksonDecoder
Process the input publisher into a flux. Default implementation returnsFlux.from(Publisher)
, but subclasses can choose to customize this behavior.- Overrides:
processInput
in classAbstractJacksonDecoder
- Parameters:
input
- theDataBuffer
input stream to processelementType
- the expected type of elements in the output streammimeType
- the MIME type associated with the input stream (optional)hints
- additional information about how to do encode- Returns:
- the processed flux
-