类 ExceptionHandlerAnnotationExceptionHandler

java.lang.Object
cn.taketoday.core.OrderedSupport
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.beans.factory.InitializingBean, cn.taketoday.context.ApplicationContextAware, cn.taketoday.core.Ordered, HandlerExceptionHandler

public class ExceptionHandlerAnnotationExceptionHandler extends AbstractActionMappingMethodExceptionHandler implements cn.taketoday.context.ApplicationContextAware, cn.taketoday.beans.factory.InitializingBean
Handle ExceptionHandler annotated method

this method indicates that is a exception handler

从以下版本开始:
2.3.7
作者:
TODAY 2019-06-22 19:17
  • 字段详细资料

  • 构造器详细资料

    • ExceptionHandlerAnnotationExceptionHandler

      public ExceptionHandlerAnnotationExceptionHandler()
  • 方法详细资料

    • handleInternal

      @Nullable protected Object handleInternal(RequestContext context, @Nullable HandlerMethod handlerMethod, Throwable target)
      Actually resolve the given exception that got thrown during on handler execution, returning a view(result) that represents a specific error page if appropriate.

      May be overridden in subclasses, in order to apply specific exception checks. Note that this template method will be invoked after checking whether this resolved applies ("mappedHandlers" etc), so an implementation may simply proceed with its actual exception handling.

      指定者:
      handleInternal 在类中 AbstractActionMappingMethodExceptionHandler
      参数:
      context - current HTTP request
      handlerMethod - the executed handler method, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
      target - the exception that got thrown during handler execution
      返回:
      a corresponding ModelAndView to forward to, or null for default processing
    • lookupExceptionHandler

      @Nullable protected ActionMappingAnnotationHandler lookupExceptionHandler(@Nullable HandlerMethod handlerMethod, Throwable exception)
      Find an @ExceptionHandler method for the given exception. The default implementation searches methods in the class hierarchy of the controller first and if not found, it continues searching for additional @ExceptionHandler methods assuming some @ControllerAdvice Framework-managed beans were detected.
      参数:
      exception - the raised exception
      返回:
      a method to handle the exception, or null if none
    • getHandler

      private ActionMappingAnnotationHandler getHandler(Supplier<Object> handlerBean, Method method, Class<?> errorHandlerType)
    • hasGlobalExceptionHandlers

      protected boolean hasGlobalExceptionHandlers()
      Whether this handler has global exception handlers, e.g. not declared in the same class as the HandlerMethod that raised the exception and therefore can apply to any handler.
      覆盖:
      hasGlobalExceptionHandlers 在类中 AbstractActionMappingMethodExceptionHandler
    • shouldApplyTo

      protected boolean shouldApplyTo(RequestContext request, @Nullable Object handler)
      Checks if the handler is a HandlerMethod and then delegates to the base class implementation of #shouldApplyTo(HttpServletRequest, Object) passing the bean of the HandlerMethod. Otherwise returns false.
      覆盖:
      shouldApplyTo 在类中 AbstractActionMappingMethodExceptionHandler
      参数:
      request - current HTTP request context
      handler - the executed handler, or null if none chosen at the time of the exception (for example, if multipart resolution failed)
      返回:
      whether this resolved should proceed with resolving the exception for the given request and handler
      另请参阅:
    • setApplicationContext

      public void setApplicationContext(@Nullable cn.taketoday.context.ApplicationContext applicationContext)
      指定者:
      setApplicationContext 在接口中 cn.taketoday.context.ApplicationContextAware
    • getApplicationContext

      @Nullable public cn.taketoday.context.ApplicationContext getApplicationContext()
    • setHandlerFactory

      public void setHandlerFactory(AnnotationHandlerFactory handlerFactory)
    • afterPropertiesSet

      public void afterPropertiesSet()
      指定者:
      afterPropertiesSet 在接口中 cn.taketoday.beans.factory.InitializingBean
    • initExceptionHandlerAdviceCache

      private void initExceptionHandlerAdviceCache(cn.taketoday.context.ApplicationContext applicationContext)