public class AnnotationDetectionMethodCallback<A extends Annotation> extends Object implements org.springframework.util.ReflectionUtils.MethodCallback
ReflectionUtils.MethodCallback
to find annotations of a given type.Constructor and Description |
---|
AnnotationDetectionMethodCallback(Class<A> annotationType)
Creates a new
AnnotationDetectionMethodCallback for the given annotation type. |
AnnotationDetectionMethodCallback(Class<A> annotationType,
boolean enforceUniqueness)
Creates a new
AnnotationDetectionMethodCallback for the given annotation type. |
Modifier and Type | Method and Description |
---|---|
void |
doWith(Method method) |
A |
getAnnotation() |
Method |
getMethod() |
boolean |
hasFoundAnnotation()
Returns whether an annotation was found.
|
public AnnotationDetectionMethodCallback(Class<A> annotationType)
AnnotationDetectionMethodCallback
for the given annotation type.annotationType
- must not be null.public AnnotationDetectionMethodCallback(Class<A> annotationType, boolean enforceUniqueness)
AnnotationDetectionMethodCallback
for the given annotation type.annotationType
- must not be null.enforceUniqueness
- whether to fail if multiple methods with the annotation are found.public Method getMethod()
public A getAnnotation()
public boolean hasFoundAnnotation()
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException
doWith
in interface org.springframework.util.ReflectionUtils.MethodCallback
IllegalArgumentException
IllegalAccessException
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.