public class ExceptionHandlerMethodResolver extends Object
Exception
to the exception types supported by a given Method.| Modifier and Type | Field and Description |
|---|---|
static ReflectionUtils.MethodFilter |
EXCEPTION_HANDLER_METHODS
A filter for selecting
@ExceptionHandler methods. |
| Constructor and Description |
|---|
ExceptionHandlerMethodResolver(Class<?> handlerType)
A constructor that finds
ExceptionHandler methods in the given type. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
detectAnnotationExceptionMappings(Method method,
List<Class<? extends Throwable>> result) |
boolean |
hasExceptionMappings()
Whether the contained type has any exception mappings.
|
Method |
resolveMethod(Exception exception)
Find a
Method to handle the given exception. |
Method |
resolveMethodByExceptionType(Class<? extends Throwable> exceptionType)
Find a
Method to handle the given exception type. |
public static final ReflectionUtils.MethodFilter EXCEPTION_HANDLER_METHODS
@ExceptionHandler methods.public ExceptionHandlerMethodResolver(Class<?> handlerType)
ExceptionHandler methods in the given type.handlerType - the type to introspectprotected void detectAnnotationExceptionMappings(Method method, List<Class<? extends Throwable>> result)
public boolean hasExceptionMappings()
public Method resolveMethod(Exception exception)
Method to handle the given exception.
Use ExceptionDepthComparator if more than one match is found.exception - the exceptionnull if none foundpublic Method resolveMethodByExceptionType(Class<? extends Throwable> exceptionType)
Method to handle the given exception type. This can be
useful if an Exception instance is not available (e.g. for tools).exceptionType - the exception typenull if none found