public abstract class AbstractExceptionHandlerMethodResolver extends Object
ExceptionDepthComparator and the top match is returned.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractExceptionHandlerMethodResolver(Map<Class<? extends Throwable>,Method> mappedMethods)
Protected constructor accepting exception-to-method mappings.
|
| Modifier and Type | Method and Description |
|---|---|
protected static List<Class<? extends Throwable>> |
getExceptionsFromMethodSignature(Method method)
Extract the exceptions this method handles.This implementation looks for
sub-classes of Throwable in the method signature.
|
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. |
protected static List<Class<? extends Throwable>> getExceptionsFromMethodSignature(Method method)
public boolean hasExceptionMappings()
@Nullable 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 found@Nullable public 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