Class HandlerResultHandlerSupport
java.lang.Object
org.springframework.web.reactive.result.HandlerResultHandlerSupport
- All Implemented Interfaces:
- Ordered
- Direct Known Subclasses:
- AbstractMessageWriterResultHandler, ViewResolutionResultHandler
Base class for 
HandlerResultHandler with support for content negotiation and access to a
ReactiveAdapter registry.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- 
Field SummaryFieldsFields inherited from interface OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedHandlerResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected @Nullable ReactiveAdaptergetAdapter(HandlerResult result) Get aReactiveAdapterfor the top-level return value type.Return the configuredReactiveAdapterRegistry.Return the configuredRequestedContentTypeResolver.intgetOrder()Get the order value of this object.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm.selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier, List<MediaType> acceptableTypes) Variant ofselectMediaType(ServerWebExchange, Supplier)with a given list of requested (acceptable) media types.voidsetOrder(int order) Set the order for this result handler relative to others.
- 
Field Details- 
loggerprotected final org.apache.commons.logging.Log logger
 
- 
- 
Constructor Details- 
HandlerResultHandlerSupportprotected HandlerResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry) 
 
- 
- 
Method Details- 
getAdapterRegistryReturn the configuredReactiveAdapterRegistry.
- 
getContentTypeResolverReturn the configuredRequestedContentTypeResolver.
- 
setOrderpublic void setOrder(int order) Set the order for this result handler relative to others.By default set to Ordered.LOWEST_PRECEDENCE, however see Javadoc of subclasses which may change this default.- Parameters:
- order- the order
 
- 
getOrderpublic int getOrder()Description copied from interface:OrderedGet the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startupvalues).Same order values will result in arbitrary sort positions for the affected objects. 
- 
getAdapterGet aReactiveAdapterfor the top-level return value type.- Returns:
- the matching adapter, or nullif none
 
- 
selectMediaTypeprotected @Nullable MediaType selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier) Select the best media type for the current request through a content negotiation algorithm.- Parameters:
- exchange- the current request
- producibleTypesSupplier- the media types producible for the request
- Returns:
- the selected media type, or nullif none
 
- 
selectMediaTypeprotected @Nullable MediaType selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier, List<MediaType> acceptableTypes) Variant ofselectMediaType(ServerWebExchange, Supplier)with a given list of requested (acceptable) media types.
 
-