public class ExceptionHandlerMethodResolver extends Object
Modifier and Type | Field and Description |
---|---|
static ReflectionUtils.MethodFilter |
EXCEPTION_HANDLER_METHODS
A filter for selecting annotated exception handling 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 Exception> exceptionType)
Find a method to handle the given exception type.
|
public static final ReflectionUtils.MethodFilter EXCEPTION_HANDLER_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)
ExceptionDepthComparator
if more than one match is found.exception
- the exceptionnull
public Method resolveMethodByExceptionType(Class<? extends Exception> exceptionType)
exceptionType
- the exception typenull