public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport implements HttpMessageDecoder<java.lang.Object>
JSON_VIEW_HINT, logger
Modifier | Constructor and Description |
---|---|
protected |
AbstractJackson2Decoder(ObjectMapper mapper,
org.springframework.util.MimeType... mimeTypes)
Constructor with a Jackson
ObjectMapper to use. |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecode(org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType) |
reactor.core.publisher.Flux<java.lang.Object> |
decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input,
org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Object> |
decodeToMono(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input,
org.springframework.core.ResolvableType elementType,
org.springframework.util.MimeType mimeType,
java.util.Map<java.lang.String,java.lang.Object> hints) |
protected <A extends java.lang.annotation.Annotation> |
getAnnotation(org.springframework.core.MethodParameter parameter,
java.lang.Class<A> annotType) |
java.util.List<org.springframework.util.MimeType> |
getDecodableMimeTypes() |
java.util.Map<java.lang.String,java.lang.Object> |
getDecodeHints(org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
ServerHttpRequest request,
ServerHttpResponse response)
Get decoding hints based on the server request or annotations on the
target controller method parameter.
|
getHints, getJavaType, getMimeTypes, getObjectMapper, getParameter, supportsMimeType
protected AbstractJackson2Decoder(ObjectMapper mapper, org.springframework.util.MimeType... mimeTypes)
ObjectMapper
to use.public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType)
canDecode
in interface org.springframework.core.codec.Decoder<java.lang.Object>
public reactor.core.publisher.Flux<java.lang.Object> decode(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable java.util.Map<java.lang.String,java.lang.Object> hints)
decode
in interface org.springframework.core.codec.Decoder<java.lang.Object>
public reactor.core.publisher.Mono<java.lang.Object> decodeToMono(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable java.util.Map<java.lang.String,java.lang.Object> hints)
decodeToMono
in interface org.springframework.core.codec.Decoder<java.lang.Object>
public java.util.Map<java.lang.String,java.lang.Object> getDecodeHints(org.springframework.core.ResolvableType actualType, org.springframework.core.ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response)
HttpMessageDecoder
getDecodeHints
in interface HttpMessageDecoder<java.lang.Object>
actualType
- the actual target type to decode to, possibly a reactive
wrapper and sourced from MethodParameter
,
i.e. providing access to method parameter annotationselementType
- the element type within Flux/Mono
that we're
trying to decode torequest
- the current requestresponse
- the current responsepublic java.util.List<org.springframework.util.MimeType> getDecodableMimeTypes()
getDecodableMimeTypes
in interface org.springframework.core.codec.Decoder<java.lang.Object>
protected <A extends java.lang.annotation.Annotation> A getAnnotation(org.springframework.core.MethodParameter parameter, java.lang.Class<A> annotType)
getAnnotation
in class Jackson2CodecSupport