Class AnnotationMethodResolver
java.lang.Object
org.springframework.classify.util.AnnotationMethodResolver
- All Implemented Interfaces:
MethodResolver
MethodResolver implementation that finds a single Method on the given Class
that contains the specified annotation type.
- Author:
- Mark Fisher
-
Constructor Summary
ConstructorDescriptionAnnotationMethodResolver
(Class<? extends Annotation> annotationType) Create a MethodResolver for the specified Method-level annotation type -
Method Summary
Modifier and TypeMethodDescriptionfindMethod
(Class<?> clazz) Find a single Method on the given Class that contains the annotation type for which this resolver is searching.findMethod
(Object candidate) Find a single Method on the Class of the given candidate object that contains the annotation type for which this resolver is searching.
-
Constructor Details
-
AnnotationMethodResolver
Create a MethodResolver for the specified Method-level annotation type- Parameters:
annotationType
- the type of the annotation
-
-
Method Details
-
findMethod
Find a single Method on the Class of the given candidate object that contains the annotation type for which this resolver is searching.- Specified by:
findMethod
in interfaceMethodResolver
- Parameters:
candidate
- the instance whose Class will be checked for the annotation- Returns:
- a single matching Method instance or
null
if the candidate's Class contains no Methods with the specified annotation - Throws:
IllegalArgumentException
- if more than one Method has the specified annotation
-
findMethod
Find a single Method on the given Class that contains the annotation type for which this resolver is searching.- Specified by:
findMethod
in interfaceMethodResolver
- Parameters:
clazz
- the Class instance to check for the annotation- Returns:
- a single matching Method instance or
null
if the Class contains no Methods with the specified annotation - Throws:
IllegalArgumentException
- if more than one Method has the specified annotation
-