类 ReturnValueHandlerManager
java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.handler.ReturnValueHandlerManager
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.context.ApplicationContextAware,cn.taketoday.core.ArraySizeTrimmer,ReturnValueHandler
public class ReturnValueHandlerManager
extends cn.taketoday.context.support.ApplicationObjectSupport
implements cn.taketoday.core.ArraySizeTrimmer, ReturnValueHandler
return-value handler manager
- 作者:
- TODAY 2019-12-28 13:47
-
字段概要
字段修饰符和类型字段说明private ContentNegotiationManagerprivate final SelectableReturnValueHandlerprivate final ArrayList<ReturnValueHandler>private Stringprivate List<HttpMessageConverter<?>>private cn.taketoday.core.ReactiveAdapterRegistryprivate RedirectModelManagerprivate cn.taketoday.core.task.AsyncTaskExecutorprivate ViewResolverprivate ViewReturnValueHandler从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.web.ReturnValueHandler
NONE_RETURN_VALUE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddHandlers(ReturnValueHandler... handlers) voidaddHandlers(List<ReturnValueHandler> handlers) voidAdd one or moreRequestBodyAdviceResponseBodyAdvicebooleanprotected booleancontains(Class<?> handlerClass, List<ReturnValueHandler> handlers) booleanfindHandler(Object handler, Object returnValue) <T> Tprotected final <T> Tget(Class<T> handlerClass, List<ReturnValueHandler> handlers) getByReturnValue(Object returnValue) search byreturnValuegetHandler(Object handler) Return the configured message body converters.getObjectHandler(SelectableReturnValueHandler compositeHandler) cn.taketoday.core.ReactiveAdapterRegistryReturn the configured reactive type registry of adapters.private RenderedImageReturnValueHandlervoidhandleReturnValue(RequestContext context, Object handler, Object returnValue) Handle result of the handlerinthashCode()obtainHandler(Object handler) Get correspond view resolver, If there isn't a suitable resolver will be throwsReturnValueHandlerNotFoundExceptionobtainHandler(Object handler, Object returnValue) Get correspond view resolver, If there isn't a suitable resolver will be throwsReturnValueHandlerNotFoundExceptionprivate ViewReturnValueHandlervoidregister default return-value handlersbooleanremoveIf(Predicate<ReturnValueHandler> filter) selectHandler(Object handler, Object returnValue) voidsetContentNegotiationManager(ContentNegotiationManager contentNegotiationManager) Set theContentNegotiationManagerto use to determine requested media types.voidsetHandlers(List<ReturnValueHandler> handlers) voidsetImageFormatName(String imageFormatName) voidsetMessageConverters(List<HttpMessageConverter<?>> messageConverters) Provide the converters to use in argument resolvers and return value handlers that support reading and/or writing to the body of the request and response.voidsetObjectHandler(ObjectHandlerMethodReturnValueHandler objectHandler) voidsetReactiveAdapterRegistry(cn.taketoday.core.ReactiveAdapterRegistry reactiveAdapterRegistry) Configure the registry for reactive library types to be supported as return values from controller methods.voidsetRedirectModelManager(RedirectModelManager redirectModelManager) voidSet one or moreRequestBodyAdviceResponseBodyAdvicevoidsetTaskExecutor(cn.taketoday.core.task.AsyncTaskExecutor taskExecutor) Set the defaultAsyncTaskExecutorto use when a controller method return aCallable.voidsetViewResolver(ViewResolver webViewResolver) voidsetViewReturnValueHandler(ViewReturnValueHandler viewReturnValueHandler) booleansupportsHandler(Object handler) If thisReturnValueHandlersupports the target handlerbooleansupportsReturnValue(Object returnValue) If thisReturnValueHandlersupports the target handler's resulttoString()void从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
handlers
-
delegate
-
redirectModelManager
- 从以下版本开始:
- 3.0.1
-
viewReturnValueHandler
-
objectHandler
-
viewResolver
-
messageConverters
-
contentNegotiationManager
-
bodyAdvice
-
taskExecutor
@Nullable private cn.taketoday.core.task.AsyncTaskExecutor taskExecutor -
imageFormatName
-
reactiveAdapterRegistry
private cn.taketoday.core.ReactiveAdapterRegistry reactiveAdapterRegistry
-
-
构造器详细资料
-
ReturnValueHandlerManager
public ReturnValueHandlerManager() -
ReturnValueHandlerManager
-
-
方法详细资料
-
setReactiveAdapterRegistry
public void setReactiveAdapterRegistry(@Nullable cn.taketoday.core.ReactiveAdapterRegistry reactiveAdapterRegistry) Configure the registry for reactive library types to be supported as return values from controller methods. -
getReactiveAdapterRegistry
public cn.taketoday.core.ReactiveAdapterRegistry getReactiveAdapterRegistry()Return the configured reactive type registry of adapters. -
addHandlers
-
addHandlers
-
setHandlers
-
getHandlers
-
asSelectable
- 返回:
- Returns SelectableReturnValueHandler
-
getHandler
-
getByReturnValue
search byreturnValue- 参数:
returnValue- returnValue- 返回:
ReturnValueHandlermaybe null
-
obtainHandler
Get correspond view resolver, If there isn't a suitable resolver will be throwsReturnValueHandlerNotFoundException- 返回:
- A suitable
ReturnValueHandler
-
findHandler
-
obtainHandler
Get correspond view resolver, If there isn't a suitable resolver will be throwsReturnValueHandlerNotFoundException- 返回:
- A suitable
ReturnValueHandler
-
selectHandler
@Nullable public ReturnValueHandler selectHandler(@Nullable Object handler, @Nullable Object returnValue) - 参数:
returnValue- if returnValue isReturnValueHandler.NONE_RETURN_VALUEmatch handler only- 返回:
- null if returnValue is
ReturnValueHandler.NONE_RETURN_VALUEor no one matched
-
handleReturnValue
public void handleReturnValue(RequestContext context, @Nullable Object handler, @Nullable Object returnValue) throws Exception 从接口复制的说明:ReturnValueHandlerHandle result of the handler- 指定者:
handleReturnValue在接口中ReturnValueHandler- 参数:
context- Current HTTP request contexthandler- Target HTTP handlerreturnValue- Handler execution result- 抛出:
ReturnValueHandlerNotFoundException- not found ReturnValueHandlerException- throws when write data to response
-
supportsHandler
从接口复制的说明:ReturnValueHandlerIf thisReturnValueHandlersupports the target handlerThis method can test this
ReturnValueHandlersupports the target handler in application startup time , static match- 指定者:
supportsHandler在接口中ReturnValueHandler- 参数:
handler- Target HTTP handler- 返回:
- If this
ReturnValueHandlersupports the target handler
-
supportsReturnValue
从接口复制的说明:ReturnValueHandlerIf thisReturnValueHandlersupports the target handler's resultThis method can test this
ReturnValueHandlersupports the target handler in application runtime- 指定者:
supportsReturnValue在接口中ReturnValueHandler- 参数:
returnValue- Target handler's return-value or result- 返回:
- If this
ReturnValueHandlersupports the target handler's result
-
registerDefaultHandlers
public void registerDefaultHandlers()register default return-value handlers -
obtainViewHandler
-
getObjectHandler
private ObjectHandlerMethodReturnValueHandler getObjectHandler(SelectableReturnValueHandler compositeHandler) -
getRenderedImageHandler
-
removeIf
- 从以下版本开始:
- 4.0
-
contains
- 从以下版本开始:
- 4.0
-
contains
- 从以下版本开始:
- 4.0
-
get
- 从以下版本开始:
- 4.0
-
get
- 从以下版本开始:
- 4.0
-
trimToSize
public void trimToSize()- 指定者:
trimToSize在接口中cn.taketoday.core.ArraySizeTrimmer- 从以下版本开始:
- 4.0
-
setViewResolver
-
setRedirectModelManager
-
getRedirectModelManager
-
setObjectHandler
-
getObjectHandler
-
setImageFormatName
-
getImageFormatName
-
setContentNegotiationManager
public void setContentNegotiationManager(@Nullable ContentNegotiationManager contentNegotiationManager) Set theContentNegotiationManagerto use to determine requested media types. If not set, the default constructor is used.- 从以下版本开始:
- 4.0
-
setMessageConverters
Provide the converters to use in argument resolvers and return value handlers that support reading and/or writing to the body of the request and response.- 从以下版本开始:
- 4.0
-
getMessageConverters
Return the configured message body converters.- 从以下版本开始:
- 4.0
-
addRequestResponseBodyAdvice
Add one or moreRequestBodyAdviceResponseBodyAdvice- 从以下版本开始:
- 4.0
- 另请参阅:
-
setRequestResponseBodyAdvice
Set one or moreRequestBodyAdviceResponseBodyAdviceclear all and add all
- 从以下版本开始:
- 4.0
- 另请参阅:
-
getRequestResponseBodyAdvice
- 从以下版本开始:
- 4.0
-
setViewReturnValueHandler
-
setTaskExecutor
public void setTaskExecutor(cn.taketoday.core.task.AsyncTaskExecutor taskExecutor) Set the defaultAsyncTaskExecutorto use when a controller method return aCallable. Controller methods can override this default on a per-request basis by returning anWebAsyncTask.By default a
SimpleAsyncTaskExecutorinstance is used. It's recommended to change that default in production as the simple executor does not re-use threads.- 从以下版本开始:
- 4.0
-
equals
-
hashCode
public int hashCode() -
toString
-