T
- the type of objects in the input streampublic interface HttpMessageWriter<T>
<T>
and writing
the encoded stream of bytes to an ReactiveHttpOutputMessage
.Modifier and Type | Method and Description |
---|---|
boolean |
canWrite(ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this writer.
|
List<MediaType> |
getWritableMediaTypes()
Return the
MediaType 's that this writer supports. |
reactor.core.publisher.Mono<Void> |
write(org.reactivestreams.Publisher<? extends T> inputStream,
ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
Map<String,Object> hints)
Write an given stream of object to the output message.
|
default reactor.core.publisher.Mono<Void> |
write(org.reactivestreams.Publisher<? extends T> inputStream,
ResolvableType actualType,
ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
Map<String,Object> hints)
Server-side only alternative to
write(Publisher, ResolvableType, MediaType, ReactiveHttpOutputMessage, Map)
with additional context available. |
List<MediaType> getWritableMediaTypes()
MediaType
's that this writer supports.boolean canWrite(ResolvableType elementType, @Nullable MediaType mediaType)
elementType
- the type of object to checkmediaType
- the media type for the write, possibly null
true
if writable, false
otherwisereactor.core.publisher.Mono<Void> write(org.reactivestreams.Publisher<? extends T> inputStream, ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage message, Map<String,Object> hints)
inputStream
- the objects to writeelementType
- the type of objects in the stream which must have been
previously checked via canWrite(ResolvableType, MediaType)
mediaType
- the content type for the write, possibly null
to
indicate that the default content type of the writer must be used.message
- the message to write tohints
- additional information about how to encode and writedefault reactor.core.publisher.Mono<Void> write(org.reactivestreams.Publisher<? extends T> inputStream, ResolvableType actualType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response, Map<String,Object> hints)
write(Publisher, ResolvableType, MediaType, ReactiveHttpOutputMessage, Map)
with additional context available.actualType
- the actual return type of the method that returned the
value; for annotated controllers, the MethodParameter
can be
accessed via ResolvableType.getSource()
.elementType
- the type of Objects in the input streammediaType
- the content type to use, possibly null
indicating
the default content type of the writer should be used.request
- the current requestresponse
- the current responseMono
that indicates completion of writing or error