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 SummaryFieldsFields inherited from class HandlerResultHandlerSupportloggerFields inherited from interface OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver) Constructor withHttpMessageWritersand aRequestedContentTypeResolver.protectedAbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) Constructor with an additionalReactiveAdapterRegistry.protectedAbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry, List<ErrorResponse.Interceptor> interceptors) Variant ofAbstractMessageWriterResultHandler(List, RequestedContentTypeResolver, ReactiveAdapterRegistry)with additional list ofErrorResponse.Interceptors for return value handling.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the configuredErrorResponse.Interceptor's.Return the configured message converters.protected voidinvokeErrorResponseInterceptors(ProblemDetail detail, @Nullable ErrorResponse errorResponse) Invoke the configuredErrorResponse.Interceptor's.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.protected reactor.core.publisher.Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParameter, ServerWebExchange exchange) Write a given body to the response withHttpMessageWriter.Methods inherited from class HandlerResultHandlerSupportgetAdapter, getAdapterRegistry, getContentTypeResolver, getOrder, selectMediaType, selectMediaType, setOrder
- 
Field Details- 
COROUTINES_FLOW_CLASS_NAME- See Also:
 
 
- 
- 
Constructor Details- 
AbstractMessageWriterResultHandlerprotected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver) Constructor withHttpMessageWritersand aRequestedContentTypeResolver.- Parameters:
- messageWriters- for serializing Objects to the response body stream
- contentTypeResolver- for resolving the requested content type
 
- 
AbstractMessageWriterResultHandlerprotected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) Constructor with an additionalReactiveAdapterRegistry.- Parameters:
- messageWriters- for serializing Objects to the response body stream
- contentTypeResolver- for resolving the requested content type
- adapterRegistry- for adapting other reactive types (for example, rx.Observable, rx.Single, etc.) to Flux or Mono
 
- 
AbstractMessageWriterResultHandlerprotected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry, List<ErrorResponse.Interceptor> interceptors) Variant ofAbstractMessageWriterResultHandler(List, RequestedContentTypeResolver, ReactiveAdapterRegistry)with additional list ofErrorResponse.Interceptors for return value handling.- Since:
- 6.2
 
 
- 
- 
Method Details- 
getMessageWritersReturn the configured message converters.
- 
getErrorResponseInterceptorsReturn the configuredErrorResponse.Interceptor's.- Since:
- 6.2
 
- 
invokeErrorResponseInterceptorsprotected void invokeErrorResponseInterceptors(ProblemDetail detail, @Nullable ErrorResponse errorResponse) Invoke the configuredErrorResponse.Interceptor's.- Since:
- 6.2
 
- 
writeBodyprotected 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 write
- bodyParameter- the- MethodParameterof the body to write
- exchange- the current exchange
- Returns:
- indicates completion or error
- See Also:
 
- 
writeBodyprotected 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 write
- bodyParameter- the- MethodParameterof the body to write
- actualParam- the actual return type of the method that returned the value; could be different from- bodyParameterwhen processing- HttpEntityfor example
- exchange- the current exchange
- Returns:
- indicates completion or error
- Since:
- 5.0.2
 
 
-