public abstract class ContentNegotiatingResultHandlerSupport extends Object implements Ordered
HandlerResultHandler
implementations that perform content negotiation.HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Modifier | Constructor and Description |
---|---|
protected |
ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver) |
protected |
ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver,
ReactiveAdapterRegistry adapterRegistry) |
Modifier and Type | Method and Description |
---|---|
ReactiveAdapterRegistry |
getAdapterRegistry()
Return the configured
ReactiveAdapterRegistry . |
RequestedContentTypeResolver |
getContentTypeResolver()
Return the configured
RequestedContentTypeResolver . |
int |
getOrder()
Get the order value of this object.
|
protected MediaType |
selectMediaType(ServerWebExchange exchange,
List<MediaType> producibleTypes)
Select the best media type for the current request through a content
negotiation algorithm.
|
void |
setOrder(int order)
Set the order for this result handler relative to others.
|
protected ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver)
protected ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)
public ReactiveAdapterRegistry getAdapterRegistry()
ReactiveAdapterRegistry
.public RequestedContentTypeResolver getContentTypeResolver()
RequestedContentTypeResolver
.public void setOrder(int order)
By default set to Ordered.LOWEST_PRECEDENCE
, however see
Javadoc of sub-classes which may change this default.
order
- the orderpublic int getOrder()
Ordered
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-startup
values).
Same order values will result in arbitrary sort positions for the affected objects.
getOrder
in interface Ordered
Ordered.HIGHEST_PRECEDENCE
,
Ordered.LOWEST_PRECEDENCE
protected MediaType selectMediaType(ServerWebExchange exchange, List<MediaType> producibleTypes)
exchange
- the current requestproducibleTypes
- the media types that can be produced for the current requestnull