T
- the type of objects in the decoded output streampublic interface HttpMessageReader<T>
ReactiveHttpInputMessage
and decoding
the stream of bytes to Objects of type <T>
.Modifier and Type | Method and Description |
---|---|
boolean |
canRead(ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this reader.
|
List<MediaType> |
getReadableMediaTypes()
Return the list of media types supported by this reader.
|
default List<MediaType> |
getReadableMediaTypes(ResolvableType elementType)
Return the list of media types supported by this Reader for the given type
of element.
|
reactor.core.publisher.Flux<T> |
read(ResolvableType elementType,
ReactiveHttpInputMessage message,
Map<String,Object> hints)
Read from the input message and decode to a stream of objects.
|
default reactor.core.publisher.Flux<T> |
read(ResolvableType actualType,
ResolvableType elementType,
ServerHttpRequest request,
ServerHttpResponse response,
Map<String,Object> hints)
Server-side only alternative to
read(ResolvableType, ReactiveHttpInputMessage, Map)
with additional context available. |
reactor.core.publisher.Mono<T> |
readMono(ResolvableType elementType,
ReactiveHttpInputMessage message,
Map<String,Object> hints)
Read from the input message and decode to a single object.
|
default reactor.core.publisher.Mono<T> |
readMono(ResolvableType actualType,
ResolvableType elementType,
ServerHttpRequest request,
ServerHttpResponse response,
Map<String,Object> hints)
Server-side only alternative to
readMono(ResolvableType, ReactiveHttpInputMessage, Map)
with additional, context available. |
List<MediaType> getReadableMediaTypes()
canWrite(elementType, null)
. The list may also exclude media types
supported only for a specific element type. Alternatively, use
getReadableMediaTypes(ResolvableType)
for a more precise list.default List<MediaType> getReadableMediaTypes(ResolvableType elementType)
getReadableMediaTypes()
if the Reader doesn't support the element type, or if it supports it
only for a subset of media types.elementType
- the type of element to readboolean canRead(ResolvableType elementType, @Nullable MediaType mediaType)
elementType
- the type of object to checkmediaType
- the media type for the read (possibly null
)true
if readable, false
otherwisereactor.core.publisher.Flux<T> read(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
elementType
- the type of objects in the stream which must have been
previously checked via canRead(ResolvableType, MediaType)
message
- the message to read fromhints
- additional information about how to read and decode the inputreactor.core.publisher.Mono<T> readMono(ResolvableType elementType, ReactiveHttpInputMessage message, Map<String,Object> hints)
elementType
- the type of objects in the stream which must have been
previously checked via canRead(ResolvableType, MediaType)
message
- the message to read fromhints
- additional information about how to read and decode the inputdefault reactor.core.publisher.Flux<T> read(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response, Map<String,Object> hints)
read(ResolvableType, ReactiveHttpInputMessage, Map)
with additional context available.actualType
- the actual type of the target method parameter;
for annotated controllers, the MethodParameter
can be accessed
via ResolvableType.getSource()
.elementType
- the type of Objects in the output streamrequest
- the current requestresponse
- the current responsehints
- additional information about how to read the bodydefault reactor.core.publisher.Mono<T> readMono(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response, Map<String,Object> hints)
readMono(ResolvableType, ReactiveHttpInputMessage, Map)
with additional, context available.actualType
- the actual type of the target method parameter;
for annotated controllers, the MethodParameter
can be accessed
via ResolvableType.getSource()
.elementType
- the type of Objects in the output streamrequest
- the current requestresponse
- the current responsehints
- additional information about how to read the body