JavaScript is disabled on your browser.
java.lang.Object
org.springframework.http.codec.ServerSentEventHttpMessageWriter
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
boolean
canWrite (ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this writer.
Encoder <?>
getEncoder ()
Return the configured Encoder
, if any.
java.util.List<MediaType >
getWritableMediaTypes ()
Return the
MediaType
's that this writer supports.
reactor.core.publisher.Mono<java.lang.Void>
write (org.reactivestreams.Publisher<?> input,
ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints)
Write an given stream of object to the output message.
reactor.core.publisher.Mono<java.lang.Void>
write (org.reactivestreams.Publisher<?> input,
ResolvableType actualType,
ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail
canWrite
public boolean canWrite(ResolvableType elementType,
@Nullable
MediaType mediaType)
Whether the given object type is supported by this writer.
Specified by:
canWrite
in interface HttpMessageWriter <java.lang.Object>
Parameters:
elementType
- the type of object to check
mediaType
- the media type for the write, possibly null
Returns:
true
if writable, false
otherwise
write
public reactor.core.publisher.Mono<java.lang.Void> write(org.reactivestreams.Publisher<?> input,
ResolvableType elementType,
@Nullable
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints)
Write an given stream of object to the output message.
Specified by:
write
in interface HttpMessageWriter <java.lang.Object>
Parameters:
input
- the objects to write
elementType
- the type of objects in the stream which must have been
previously checked via HttpMessageWriter.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 to
hints
- additional information about how to encode and write
Returns:
indicates completion or error
write
public reactor.core.publisher.Mono<java.lang.Void> write(org.reactivestreams.Publisher<?> input,
ResolvableType actualType,
ResolvableType elementType,
@Nullable
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints)
Specified by:
write
in interface HttpMessageWriter <java.lang.Object>
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 stream
mediaType
- the content type to use, possibly null
indicating
the default content type of the writer should be used.
request
- the current request
response
- the current response
Returns:
a Mono
that indicates completion of writing or error