HttpMessageReader that wraps and delegates to a Decoder.
Also a HttpMessageReader that pre-resolves decoding hints
from the extra information available on the server side such as the request
or controller method parameter annotations.
| Modifier and Type | Field and Description |
|---|---|
| private final Decoder | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | canRead(ResolvableType
the type of object to check elementType, MediaType the media type for the read (possibly mediaType)null)Implements org. |
| protected MediaType | Returns: the MediaType, possiblynull.the HTTP message inputMessage)Determine the Content-Type of the HTTP message based on the
"Content-Type" header or otherwise default to
|
| public Decoder | |
| public List | getReadableMediaTypes()
Implements org. |
| public List | getReadableMediaTypes(ResolvableType
the type of element to read elementType)Overrides default org. |
| protected Map | getReadHints(ResolvableType elementType, ReactiveHttpInputMessage message)
Get additional hints for decoding based on the input HTTP message. |
| protected Map | getReadHints(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response)
Get additional hints for decoding for example based on the server request or annotations from controller method parameters. |
| private static void | |
| public Flux | read(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. |
| public Flux | read(ResolvableType
the actual type of the target method parameter;
for annotated controllers, the actualType, ResolvableType MethodParameter can be accessed
via ResolvableType#getSource().the type of Objects in the output stream elementType, ServerHttpRequest the current request request, ServerHttpResponse the current response response, Map<String, Object> additional information about how to read the body hints)Overrides default org. read(ResolvableType, ReactiveHttpInputMessage, Map)
with additional context available.
|
| public Mono | readMono(ResolvableType
the type of objects in the stream which must have been
previously checked via elementType, ReactiveHttpInputMessage canRead(ResolvableType, MediaType)the message to read from message, Map<String, Object> additional information about how to read and decode the input hints)Implements org. |
| public Mono | readMono(ResolvableType
the actual type of the target method parameter;
for annotated controllers, the actualType, ResolvableType MethodParameter can be accessed
via ResolvableType#getSource().the type of Objects in the output stream elementType, ServerHttpRequest the current request request, ServerHttpResponse the current response response, Map<String, Object> additional information about how to read the body hints)Overrides default org. readMono(ResolvableType, ReactiveHttpInputMessage, Map)
with additional, context available.
|
| decoder | back to summary |
|---|---|
| private final Decoder<T> decoder | |
| mediaTypes | back to summary |
|---|---|
| private final List<MediaType> mediaTypes | |
| DecoderHttpMessageReader | back to summary |
|---|---|
| public DecoderHttpMessageReader(Decoder<T> decoder) Create an instance wrapping the given | |
| canRead | back to summary |
|---|---|
| public boolean canRead(ResolvableType elementType, MediaType mediaType) Implements org. Doc from org. Whether the given object type is supported by this reader.
| |
| getContentType | back to summary |
|---|---|
| protected MediaType getContentType(HttpMessage inputMessage) Determine the Content-Type of the HTTP message based on the
"Content-Type" header or otherwise default to
| |
| getDecoder | back to summary |
|---|---|
| public Decoder Return the | |
| getReadableMediaTypes | back to summary |
|---|---|
| public List Implements org. Doc from org. Return the list of media types supported by this reader. The list may not
apply to every possible target element type and calls to this method
should typically be guarded via | |
| getReadableMediaTypes | back to summary |
|---|---|
| public List Overrides default org. Doc from org. Return the list of media types supported by this Reader for the given type
of element. This list may differ from
| |
| getReadHints | back to summary |
|---|---|
| protected Map Get additional hints for decoding based on the input HTTP message.
| |
| getReadHints | back to summary |
|---|---|
| protected Map Get additional hints for decoding for example based on the server request
or annotations from controller method parameters. By default, delegate to
the decoder if it is an instance of | |
| initLogger | back to summary |
|---|---|
| private static void initLogger(Decoder<?> decoder) | |
| read | back to summary |
|---|---|
| public Flux Implements org. Doc from org. Read from the input message and decode to a stream of objects.
| |
| read | back to summary |
|---|---|
| public Flux Overrides default org. Doc from org. Server-side only alternative to
| |
| readMono | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Read from the input message and decode to a single object.
| |
| readMono | back to summary |
|---|---|
| public Mono Overrides default org. Doc from org. Server-side only alternative to
| |