/** * Get all annotations present on the represented class * * @return the set of all annotations on the class this refers to */ public Set<Annotation> getClassAnnotations() { return new HashSet<Annotation>( classData.getAnnotations() ); }
/** * Get all annotations present on the represented class * * @return the set of all annotations on the class this refers to */ public Set<Annotation> getClassAnnotations() { return new HashSet<Annotation>( classData.getAnnotations() ); }
/** * Gets the annotation from the represented class if one exists of the type specified * * @param annotationType * the annotation type to look for on this class * @return the annotation if found OR null if none found */ @SuppressWarnings({ "unchecked", "hiding" }) public <T extends Annotation> T getClassAnnotation(Class<T> annotationType) { if (annotationType == null) { throw new IllegalArgumentException("annotationType must not be null"); } T annote = null; List<Annotation> annotations = classData.getAnnotations(); for (Annotation annotation : annotations) { if (annotationType.equals(annotation.annotationType())) { annote = (T) annotation; break; } } return annote; }
/** * Gets the annotation from the represented class if one exists of the type specified * * @param annotationType * the annotation type to look for on this class * @return the annotation if found OR null if none found */ @SuppressWarnings({ "unchecked", "hiding" }) public <T extends Annotation> T getClassAnnotation(Class<T> annotationType) { if (annotationType == null) { throw new IllegalArgumentException("annotationType must not be null"); } T annote = null; List<Annotation> annotations = classData.getAnnotations(); for (Annotation annotation : annotations) { if (annotationType.equals(annotation.annotationType())) { annote = (T) annotation; break; } } return annote; }
List<Annotation> annotations = classData.getAnnotations(); for (Annotation annotation : annotations) {
List<Annotation> annotations = classData.getAnnotations(); for (Annotation annotation : annotations) {