List of utility methods to do Reflection Annotation
A | getAnnotation(Method method, Class annotationType) get Annotation A ann = method.getAnnotation(annotationType); if (ann == null) { for (Annotation metaAnn : method.getAnnotations()) { ann = metaAnn.annotationType().getAnnotation(annotationType); if (ann != null) { break; return ann; |
T | getAnnotation(Method method, Class Extract the annotation from the method or the declaring class. T t = method.getAnnotation(annotationClass); if (t == null) { t = getAnnotation(method.getDeclaringClass(), annotationClass); return t; |
T | getAnnotation(Method method, Class get Annotation T t = getAnnotation(method, annotationClass, annotationClass.isAnnotationPresent(Inherited.class)); return t; |
T | getAnnotation(Method method, Class Returns the first Annotation of the given type defined on the given Method . for (Annotation a : getAnnotations(method)) { if (type.isInstance(a)) { return type.cast(a); return null; |
A | getAnnotation(Object bean, final Class annotation) get Annotation if (bean == null) { return null; return getAnnotation(bean.getClass(), annotation); |
T | getAnnotation(Object context, Class Takes the target IckleActivity and finds the given annotation (if any). Class<?> contextClass = context.getClass(); if (contextClass.isAnnotationPresent(annotation)) { return contextClass.getAnnotation(annotation); } else { return null; |
A | getAnnotation(Object instance, Class type) Gets the annotation from the given instance. return instance.getClass().getAnnotation(type);
|
Annotation | getAnnotation(Object obj, Class> annClass) get Annotation return getAnnotation(obj.getClass(), annClass);
|
A | getAnnotation(Object obj, Class acl) get Annotation return getAnnotation(obj.getClass(), acl);
|
A | getAnnotation(Object obj, Class annotation) get Annotation Objects.requireNonNull(obj);
return obj.getClass().getDeclaredAnnotation(annotation);
|