The list of methods to do Reflection Annotation are organized into topic(s).
T
getAnnotation(final Method method, final Class annotationClass) get Annotation
final T annotation = method.getAnnotation(annotationClass);
if (annotation != null) {
return annotation;
final Class<?> declaringClass = method.getDeclaringClass();
Class<?> currentSuperClass = declaringClass.getSuperclass();
while (currentSuperClass != null) {
try {
...
T
getAnnotation(AnnotatedElement ae, Class annotationType) Get a single Annotation of annotationType from the supplied Method, Constructor or Field.
T ann = ae.getAnnotation(annotationType);
if (ann == null) {
for (Annotation metaAnn : ae.getAnnotations()) {
ann = metaAnn.annotationType().getAnnotation(annotationType);
if (ann != null) {
break;
return ann;