Class AbstractMessageWriterResultHandler
java.lang.Object
org.springframework.web.reactive.result.HandlerResultHandlerSupport
org.springframework.web.reactive.result.method.annotation.AbstractMessageWriterResultHandler
- All Implemented Interfaces:
Ordered
- Direct Known Subclasses:
ResponseBodyResultHandler
,ResponseEntityResultHandler
Abstract base class for result handlers that handle return values by writing
to the response with
HttpMessageWriter
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Sebastien Deleuze
-
Field Summary
Fields inherited from class org.springframework.web.reactive.result.HandlerResultHandlerSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMessageWriterResultHandler
(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver) Constructor withHttpMessageWriters
and aRequestedContentTypeResolver
.protected
AbstractMessageWriterResultHandler
(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) Constructor with an additionalReactiveAdapterRegistry
. -
Method Summary
Modifier and TypeMethodDescriptionReturn the configured message converters.protected reactor.core.publisher.Mono<Void>
writeBody
(Object body, MethodParameter bodyParameter, MethodParameter actualParam, ServerWebExchange exchange) Write a given body to the response withHttpMessageWriter
.protected reactor.core.publisher.Mono<Void>
writeBody
(Object body, MethodParameter bodyParameter, ServerWebExchange exchange) Write a given body to the response withHttpMessageWriter
.Methods inherited from class org.springframework.web.reactive.result.HandlerResultHandlerSupport
getAdapter, getAdapterRegistry, getContentTypeResolver, getOrder, selectMediaType, selectMediaType, setOrder
-
Field Details
-
COROUTINES_FLOW_CLASS_NAME
- See Also:
-
-
Constructor Details
-
AbstractMessageWriterResultHandler
protected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver) Constructor withHttpMessageWriters
and aRequestedContentTypeResolver
.- Parameters:
messageWriters
- for serializing Objects to the response body streamcontentTypeResolver
- for resolving the requested content type
-
AbstractMessageWriterResultHandler
protected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) Constructor with an additionalReactiveAdapterRegistry
.- Parameters:
messageWriters
- for serializing Objects to the response body streamcontentTypeResolver
- for resolving the requested content typeadapterRegistry
- for adapting other reactive types (e.g. rx.Observable, rx.Single, etc.) to Flux or Mono
-
-
Method Details
-
getMessageWriters
Return the configured message converters. -
writeBody
protected reactor.core.publisher.Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParameter, ServerWebExchange exchange) Write a given body to the response withHttpMessageWriter
.- Parameters:
body
- the object to writebodyParameter
- theMethodParameter
of the body to writeexchange
- the current exchange- Returns:
- indicates completion or error
- See Also:
-
writeBody
protected reactor.core.publisher.Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParameter, @Nullable MethodParameter actualParam, ServerWebExchange exchange) Write a given body to the response withHttpMessageWriter
.- Parameters:
body
- the object to writebodyParameter
- theMethodParameter
of the body to writeactualParam
- the actual return type of the method that returned the value; could be different frombodyParameter
when processingHttpEntity
for exampleexchange
- the current exchange- Returns:
- indicates completion or error
- Since:
- 5.0.2
-