public class ResponseEntityResultHandler extends AbstractMessageWriterResultHandler implements HandlerResultHandler
HttpEntity
and ResponseEntity
return values.
By default the order for this result handler is set to 0. It is generally safe to place it early in the order as it looks for a concrete return type.
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ResponseEntityResultHandler(List<HttpMessageWriter<?>> writers,
RequestedContentTypeResolver resolver)
Basic constructor with a default
ReactiveAdapterRegistry . |
ResponseEntityResultHandler(List<HttpMessageWriter<?>> writers,
RequestedContentTypeResolver resolver,
ReactiveAdapterRegistry registry)
Constructor with an
ReactiveAdapterRegistry instance. |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Void> |
handleResult(ServerWebExchange exchange,
HandlerResult result)
Process the given result modifying response headers and/or writing data
to the response.
|
boolean |
supports(HandlerResult result)
Whether this handler supports the given
HandlerResult . |
getMessageWriters, writeBody, writeBody
getAdapter, getAdapterRegistry, getContentTypeResolver, getOrder, selectMediaType, setOrder
public ResponseEntityResultHandler(List<HttpMessageWriter<?>> writers, RequestedContentTypeResolver resolver)
ReactiveAdapterRegistry
.writers
- the writers for serializing to the response bodyresolver
- to determine the requested content typepublic ResponseEntityResultHandler(List<HttpMessageWriter<?>> writers, RequestedContentTypeResolver resolver, ReactiveAdapterRegistry registry)
ReactiveAdapterRegistry
instance.writers
- the writers for serializing to the response bodyresolver
- to determine the requested content typeregistry
- for adaptation to reactive typespublic boolean supports(HandlerResult result)
HandlerResultHandler
HandlerResult
.supports
in interface HandlerResultHandler
result
- the result object to checkpublic reactor.core.publisher.Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result)
HandlerResultHandler
handleResult
in interface HandlerResultHandler
exchange
- current server exchangeresult
- the result from the handlingMono<Void>
to indicate when request handling is complete.