Class ExceptionResolverMethodResolver
java.lang.Object
org.springframework.shell.command.annotation.ExceptionResolverMethodResolver
-
Constructor Summary
ConstructorsConstructorDescriptionExceptionResolverMethodResolver(Class<?> handlerType) A constructor that findsExceptionResolvermethods in the given type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the contained type has any exception mappings.resolveMethod(Exception exception) Find aMethodto handle the given exception.resolveMethodByExceptionType(Class<? extends Throwable> exceptionType) Find aMethodto handle the given exception type.resolveMethodByThrowable(Throwable exception) Find aMethodto handle the given Throwable.
-
Constructor Details
-
ExceptionResolverMethodResolver
A constructor that findsExceptionResolvermethods 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 aMethodto handle the given exception.Uses
ExceptionDepthComparatorif more than one match is found.- Parameters:
exception- the exception- Returns:
- a Method to handle the exception, or
nullif none found
-
resolveMethodByThrowable
Find aMethodto handle the given Throwable.Uses
ExceptionDepthComparatorif more than one match is found.- Parameters:
exception- the exception- Returns:
- a Method to handle the exception, or
nullif none found
-
resolveMethodByExceptionType
Find aMethodto handle the given exception type. This can be useful if anExceptioninstance is not available (e.g. for tools).Uses
ExceptionDepthComparatorif more than one match is found.- Parameters:
exceptionType- the exception type- Returns:
- a Method to handle the exception, or
nullif none found
-