程序包 cn.taketoday.web

接口 ReturnValueHandler

所有已知子接口:
HandlerMethodReturnValueHandler, SmartReturnValueHandler
所有已知实现类:
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
另请参阅:
  • 字段详细资料

    • NONE_RETURN_VALUE

      static final Object NONE_RETURN_VALUE
  • 方法详细资料

    • supportsHandler

      boolean supportsHandler(Object handler)
      If this ReturnValueHandler supports the target handler

      This method can test this ReturnValueHandler supports the target handler in application startup time , static match

      参数:
      handler - Target HTTP handler
      返回:
      If this ReturnValueHandler supports the target handler
    • supportsReturnValue

      default boolean supportsReturnValue(@Nullable Object returnValue)
      If this ReturnValueHandler supports the target handler's result

      This method can test this ReturnValueHandler supports the target handler in application runtime

      参数:
      returnValue - Target handler's return-value or result
      返回:
      If this ReturnValueHandler supports 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 context
      handler - Target HTTP handler
      returnValue - Handler execution result Or HandlerExceptionHandler return 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 different handler and returnValue
      参数:
      handlers - Multiple ReturnValueHandlers
      handler - Request handler
      returnValue - handler's result ,if returnValue is NONE_RETURN_VALUE match handler only
      返回:
      A ReturnValueHandler that matches the situation , null if returnValue is NONE_RETURN_VALUE or no one matched