类 HandlerResultHandlerSupport
- java.lang.Object
- org.springframework.web.reactive.result.HandlerResultHandlerSupport
- 所有已实现的接口:
Ordered
public abstract class HandlerResultHandlerSupport extends Object implements Ordered
Base class forHandlerResultHandler
with support for content negotiation and access to aReactiveAdapter
registry.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 限定符 构造器 说明 protected
HandlerResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected ReactiveAdapter
getAdapter(HandlerResult result)
Get aReactiveAdapter
for the top-level return value type.ReactiveAdapterRegistry
getAdapterRegistry()
Return the configuredReactiveAdapterRegistry
.RequestedContentTypeResolver
getContentTypeResolver()
Return the configuredRequestedContentTypeResolver
.int
getOrder()
Get the order value of this object.protected MediaType
selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier)
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.
构造器详细资料
HandlerResultHandlerSupport
protected HandlerResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)
方法详细资料
getAdapterRegistry
public ReactiveAdapterRegistry getAdapterRegistry()
Return the configuredReactiveAdapterRegistry
.
getContentTypeResolver
public RequestedContentTypeResolver getContentTypeResolver()
Return the configuredRequestedContentTypeResolver
.
setOrder
public 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 sub-classes which may change this default.- 参数:
order
- the order
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get 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-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
getAdapter
@Nullable protected ReactiveAdapter getAdapter(HandlerResult result)
Get aReactiveAdapter
for the top-level return value type.- 返回:
- the matching adapter, or
null
if none
selectMediaType
@Nullable protected MediaType selectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier)
Select the best media type for the current request through a content negotiation algorithm.- 参数:
exchange
- the current requestproducibleTypesSupplier
- the media types that can be produced for the current request- 返回:
- the selected media type, or
null
if none