Class ExceptionResolverMethodResolver
java.lang.Object
org.springframework.shell.command.annotation.ExceptionResolverMethodResolver
-
Constructor Summary
ConstructorDescriptionExceptionResolverMethodResolver
(Class<?> handlerType) A constructor that findsExceptionResolver
methods in the given type. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether the contained type has any exception mappings.resolveMethod
(Exception exception) Find aMethod
to handle the given exception.resolveMethodByExceptionType
(Class<? extends Throwable> exceptionType) Find aMethod
to handle the given exception type.resolveMethodByThrowable
(Throwable exception) Find aMethod
to handle the given Throwable.
-
Constructor Details
-
ExceptionResolverMethodResolver
A constructor that findsExceptionResolver
methods in the given type.- Parameters:
handlerType
- the type to introspect
-
-
Method Details
-
hasExceptionMappings
public boolean hasExceptionMappings()Whether the contained type has any exception mappings. -
resolveMethod
Find aMethod
to handle the given exception.Uses
ExceptionDepthComparator
if more than one match is found.- Parameters:
exception
- the exception- Returns:
- a Method to handle the exception, or
null
if none found
-
resolveMethodByThrowable
Find aMethod
to handle the given Throwable.Uses
ExceptionDepthComparator
if more than one match is found.- Parameters:
exception
- the exception- Returns:
- a Method to handle the exception, or
null
if none found
-
resolveMethodByExceptionType
Find aMethod
to handle the given exception type. This can be useful if anException
instance is not available (e.g. for tools).Uses
ExceptionDepthComparator
if more than one match is found.- Parameters:
exceptionType
- the exception type- Returns:
- a Method to handle the exception, or
null
if none found
-