类 HandlerResultHandlerSupport
- java.lang.Object
- org.springframework.web.reactive.result.HandlerResultHandlerSupport
- 所有已实现的接口:
Ordered
public abstract class HandlerResultHandlerSupport extends Object implements Ordered
Base class forHandlerResultHandlerwith support for content negotiation and access to aReactiveAdapterregistry.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 限定符 构造器 说明 protectedHandlerResultHandlerSupport(RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected ReactiveAdaptergetAdapter(HandlerResult result)Get aReactiveAdapterfor the top-level return value type.ReactiveAdapterRegistrygetAdapterRegistry()Return the configuredReactiveAdapterRegistry.RequestedContentTypeResolvergetContentTypeResolver()Return the configuredRequestedContentTypeResolver.intgetOrder()Get the order value of this object.protected MediaTypeselectMediaType(ServerWebExchange exchange, Supplier<List<MediaType>> producibleTypesSupplier)Select the best media type for the current request through a content negotiation algorithm.voidsetOrder(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()
从接口复制的说明: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.
- 指定者:
getOrder在接口中Ordered- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE,Ordered.LOWEST_PRECEDENCE
getAdapter
@Nullable protected ReactiveAdapter getAdapter(HandlerResult result)
Get aReactiveAdapterfor the top-level return value type.- 返回:
- the matching adapter, or
nullif 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
nullif none