类 AbstractHandlerMethodAdapter

java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.WebContentGenerator
cn.taketoday.web.handler.method.AbstractHandlerMethodAdapter
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.context.ApplicationContextAware, cn.taketoday.core.Ordered, HandlerAdapter
直接已知子类:
RequestMappingHandlerAdapter

public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator implements HandlerAdapter, cn.taketoday.core.Ordered
Abstract base class for HandlerAdapter implementations that support handlers of type HandlerMethod.
从以下版本开始:
4.0 2022/4/8 22:46
作者:
Arjen Poutsma, Harry Yang
  • 字段详细资料

    • order

      private int order
  • 构造器详细资料

    • AbstractHandlerMethodAdapter

      public AbstractHandlerMethodAdapter()
  • 方法详细资料

    • setOrder

      public void setOrder(int order)
      Specify the order value for this HandlerAdapter bean.

      The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.

      另请参阅:
      • Ordered.getOrder()
    • getOrder

      public int getOrder()
      指定者:
      getOrder 在接口中 cn.taketoday.core.Ordered
    • supports

      public final boolean supports(Object handler)
      This implementation expects the handler to be an HandlerMethod.
      指定者:
      supports 在接口中 HandlerAdapter
      参数:
      handler - the handler instance to check
      返回:
      whether this adapter can adapt the given handler
    • supportsInternal

      protected abstract boolean supportsInternal(HandlerMethod handlerMethod)
      Given a handler method, return whether this adapter can support it.
      参数:
      handlerMethod - the handler method to check
      返回:
      whether this adapter can adapt the given method
    • handle

      @Nullable public final Object handle(RequestContext request, Object handler) throws Throwable
      This implementation expects the handler to be an HandlerMethod.
      指定者:
      handle 在接口中 HandlerAdapter
      参数:
      request - current HTTP request context
      handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
      返回:
      an object with the name of the view and the required model data, or null if the request has been handled directly
      抛出:
      Throwable - in case of errors
      另请参阅:
    • handleInternal

      @Nullable protected abstract Object handleInternal(RequestContext request, HandlerMethod handlerMethod) throws Throwable
      Use the given handler method to handle the request.
      参数:
      request - current HTTP request
      handlerMethod - handler method to use. This object must have previously been passed to the supportsInternal(HandlerMethod) this interface, which must have returned true.
      返回:
      an object to render, or null
      抛出:
      Exception - in case of errors
      Throwable