public abstract class ContentNegotiatingResultHandlerSupport extends Object implements org.springframework.core.Ordered
HandlerResultHandler
implementations that perform content negotiation.Modifier | Constructor and Description |
---|---|
protected |
ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver) |
protected |
ContentNegotiatingResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver,
org.springframework.core.ReactiveAdapterRegistry adapterRegistry) |
Modifier and Type | Method and Description |
---|---|
org.springframework.core.ReactiveAdapterRegistry |
getAdapterRegistry()
Return the configured
ReactiveAdapterRegistry . |
RequestedContentTypeResolver |
getContentTypeResolver()
Return the configured
RequestedContentTypeResolver . |
int |
getOrder() |
protected org.springframework.http.MediaType |
selectMediaType(org.springframework.web.server.ServerWebExchange exchange,
List<org.springframework.http.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, org.springframework.core.ReactiveAdapterRegistry adapterRegistry)
public org.springframework.core.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()
getOrder
in interface org.springframework.core.Ordered
protected org.springframework.http.MediaType selectMediaType(org.springframework.web.server.ServerWebExchange exchange, List<org.springframework.http.MediaType> producibleTypes)
exchange
- the current requestproducibleTypes
- the media types that can be produced for the current requestnull