程序包 cn.taketoday.web
接口 ReturnValueHandler
- 所有已知实现类:
AbstractMessageConverterMethodProcessor,AsyncTaskMethodReturnValueHandler,CallableMethodReturnValueHandler,DeferredResultReturnValueHandler,HttpEntityMethodProcessor,HttpHeadersReturnValueHandler,HttpStatusReturnValueHandler,MapMethodProcessor,ModelAttributeMethodProcessor,ModelMethodProcessor,ObjectHandlerMethodReturnValueHandler,RenderedImageReturnValueHandler,RequestResponseBodyMethodProcessor,ResponseBodyEmitterReturnValueHandler,ReturnValueHandlerDecorator,ReturnValueHandlerManager,SelectableReturnValueHandler,StreamingResponseBodyReturnValueHandler,ViewReturnValueHandler,VoidReturnValueHandler
public interface ReturnValueHandler
handler return-value Handler
Handle request-handler execution result
ReturnValueHandler is HTTP response writer
Note: This framework allows request-handler implement this interface to handle its execution result
- 作者:
- TODAY 2019-07-10 19:22
- 另请参阅:
-
字段概要
字段 -
方法概要
修饰符和类型方法说明voidhandleReturnValue(RequestContext context, Object handler, Object returnValue) Handle result of the handlerstatic ReturnValueHandlerselect(List<ReturnValueHandler> handlers, Object handler, Object returnValue) Multiple ReturnValueHandlers under the ReturnValueHandler system choose different ReturnValueHandlers corresponding to differenthandlerandreturnValuebooleansupportsHandler(Object handler) If thisReturnValueHandlersupports the target handlerdefault booleansupportsReturnValue(Object returnValue) If thisReturnValueHandlersupports the target handler's result
-
字段详细资料
-
NONE_RETURN_VALUE
-
-
方法详细资料
-
supportsHandler
If thisReturnValueHandlersupports the target handlerThis method can test this
ReturnValueHandlersupports the target handler in application startup time , static match- 参数:
handler- Target HTTP handler- 返回:
- If this
ReturnValueHandlersupports the target handler
-
supportsReturnValue
If thisReturnValueHandlersupports the target handler's resultThis method can test this
ReturnValueHandlersupports the target handler in application runtime- 参数:
returnValue- Target handler's return-value or result- 返回:
- If this
ReturnValueHandlersupports the target handler's result - 从以下版本开始:
- 4.0
-
handleReturnValue
void handleReturnValue(RequestContext context, @Nullable Object handler, @Nullable Object returnValue) throws Exception Handle result of the handler- 参数:
context- Current HTTP request contexthandler- Target HTTP handlerreturnValue- Handler execution result OrHandlerExceptionHandlerreturn value- 抛出:
Exception- return-value handled failed
-
select
@Nullable static ReturnValueHandler select(List<ReturnValueHandler> handlers, @Nullable Object handler, @Nullable Object returnValue) Multiple ReturnValueHandlers under the ReturnValueHandler system choose different ReturnValueHandlers corresponding to differenthandlerandreturnValue- 参数:
handlers- Multiple ReturnValueHandlershandler- Request handlerreturnValue- handler's result ,if returnValue isNONE_RETURN_VALUEmatch handler only- 返回:
- A ReturnValueHandler that matches the situation ,
null if returnValue is
NONE_RETURN_VALUEor no one matched
-