/** get all annotations of given {@code type}, up the super class hierarchy, optionally filtered by {@code predicates} */ public static <T extends AnnotatedElement> Set<Annotation> getAllAnnotations(T type, Predicate<Annotation>... predicates) { Set<Annotation> result = Sets.newHashSet(); if (type instanceof Class) { for (Class<?> t : getAllSuperTypes((Class<?>) type)) { result.addAll(getAnnotations(t, predicates)); } } else { result.addAll(getAnnotations(type, predicates)); } return result; }
/** get all annotations of given {@code type}, up the super class hierarchy, optionally filtered by {@code predicates} */ public static <T extends AnnotatedElement> Set<Annotation> getAllAnnotations(T type, Predicate<Annotation>... predicates) { Set<Annotation> result = Sets.newHashSet(); if (type instanceof Class) { for (Class<?> t : getAllSuperTypes((Class<?>) type)) { result.addAll(getAnnotations(t, predicates)); } } else { result.addAll(getAnnotations(type, predicates)); } return result; }
public static <T extends AnnotatedElement> Set<Annotation> getAllAnnotations(T type , Predicate<Annotation>... predicates) { Set<Annotation> result = new HashSet(); if (type instanceof Class) { for (Class<?> t : getAllSuperTypes((Class<?>) type)) { result.addAll(getAnnotations(t , predicates)); } } else { result.addAll(getAnnotations(type , predicates)); } return result; }
/** get all annotations of given {@code type}, up the super class hierarchy, optionally filtered by {@code predicates} */ public static <T extends AnnotatedElement> Set<Annotation> getAllAnnotations(T type, Predicate<Annotation>... predicates) { Set<Annotation> result = Sets.newHashSet(); if (type instanceof Class) { for (Class<?> t : getAllSuperTypes((Class<?>) type)) { result.addAll(getAnnotations(t, predicates)); } } else { result.addAll(getAnnotations(type, predicates)); } return result; }
/** get all annotations of given {@code type}, up the super class hierarchy, optionally filtered by {@code predicates} */ public static <T extends AnnotatedElement> Set<Annotation> getAllAnnotations(T type, Predicate<Annotation>... predicates) { Set<Annotation> result = Sets.newHashSet(); if (type instanceof Class) { for (Class<?> t : getAllSuperTypes((Class<?>) type)) { result.addAll(getAnnotations(t, predicates)); } } else { result.addAll(getAnnotations(type, predicates)); } return result; }
/** Returns all annotations on hierarchy. Ignores Object and interfaces. */ public static List<Annotation> getAllAnnotationsList(Class type) { ArrayList<Annotation> result = new ArrayList<Annotation>(4); for (Class t : getHierarchy(type)) { result.addAll(ReflectionUtils.getAnnotations(t)); } return result; }
/** Returns all annotations on hierarchy. Ignores Object and interfaces. */ public static List<Annotation> getAllAnnotationsList(Class type) { ArrayList<Annotation> result = new ArrayList<Annotation>(4); for (Class t : getHierarchy(type)) { result.addAll(ReflectionUtils.getAnnotations(t)); } return result; }