List of utility methods to do Reflection Annotation
A | getAnnotation(Class> cls, Class annotationClass) get Annotation A annotation = cls.getAnnotation(annotationClass); if (annotation == null) { Class<?> superClass = cls.getSuperclass(); if (superClass != null && !(superClass.equals(Object.class))) { annotation = getAnnotation(superClass, annotationClass); if (annotation == null) { ... |
T | getAnnotation(Class> cls, Class get Annotation return cls.getAnnotation(annotation);
|
T | getAnnotation(Class> componentClass, Class Search for the given annotationClass in the given componentClass and return it if search was successful. T annotation = componentClass.getAnnotation(annotationClass); if (annotation != null) { return annotation; for (Class<?> ifc : componentClass.getInterfaces()) { annotation = getAnnotation(ifc, annotationClass); if (annotation != null) { return annotation; ... |
T | getAnnotation(Class> configInterface, Method method, Class Search for an annotation on a configuration interface method. T annotation = method.getAnnotation(annotationType); if (annotation == null) { Method getMethod = getGetMethod(configInterface, method); if (getMethod != null) { annotation = getMethod.getAnnotation(annotationType); if ((annotation == null) && searchMethodType) { String methodName = method.getName(); ... |
T | getAnnotation(Class> klazz, Class get Annotation return klazz.getAnnotation(annotationClass);
|
T | getAnnotation(Class> objectClass, Class get Annotation if (objectClass == null || Object.class == objectClass) { return null; T annotation = objectClass.getAnnotation(annotationClass); if (annotation != null) { return annotation; return getAnnotation(objectClass.getSuperclass(), annotationClass); ... |
A | getAnnotation(Class> onClass, Class desiredAnnotationClass) Obtains the specified Annotation instance on the provided Class , interfaces implemented by the Class and/or the super-class(es)/super-interface(s) of the Class . if (onClass == null || desiredAnnotationClass == null) { return null; } else if (onClass.getClass().equals(Object.class)) { return null; } else { A annotation = onClass.getAnnotation(desiredAnnotationClass); if (annotation == null) { for (Class<?> onInterface : onClass.getInterfaces()) { ... |
T | getAnnotation(Class> target, Class get Annotation if (Object.class.equals(target)) { return null; try { T annotation = target.getAnnotation(annoCls); if (annotation != null) return annotation; else ... |
T | getAnnotation(Class> target, Class Returns the annotation of the annotationClass of the clazz or any of it super classes. Class<?> clazz = target; T annotation = clazz.getAnnotation(annotationClass); if (annotation != null) { return annotation; while ((clazz = clazz.getSuperclass()) != null) { annotation = clazz.getAnnotation(annotationClass); if (annotation != null) { ... |
T | getAnnotation(Class> theClass, Class Return the given annotation from the class. T aAnnotation = null; if (theClass.isAnnotationPresent(theAnnotation)) { aAnnotation = theClass.getAnnotation(theAnnotation); } else { if (shouldInspectClass(theClass.getSuperclass())) aAnnotation = getAnnotation(theClass.getSuperclass(), theAnnotation); if (aAnnotation == null) { for (Class<?> aInt : theClass.getInterfaces()) { ... |