/** * Finds and appends the specified annotation on the specified class and superclasses/interfaces to the specified * list. * * @param a The annotation. * @param t The class. * @param l The list of annotations. */ public static <T extends Annotation> void appendAnnotations(Class<T> a, Type t, List<T> l) { Class<?> c = toClass(t); if (c != null) { addIfNotNull(l, getDeclaredAnnotation(a, c)); if (c.getPackage() != null) addIfNotNull(l, c.getPackage().getAnnotation(a)); appendAnnotations(a, c.getSuperclass(), l); for (Class<?> c2 : c.getInterfaces()) appendAnnotations(a, c2, l); } }
/** * Finds and appends the specified annotation on the specified class and superclasses/interfaces to the specified * list. * * @param a The annotation. * @param t The class. * @param l The list of annotations. */ public static <T extends Annotation> void appendAnnotations(Class<T> a, Type t, List<T> l) { Class<?> c = toClass(t); if (c != null) { addIfNotNull(l, getDeclaredAnnotation(a, c)); if (c.getPackage() != null) addIfNotNull(l, c.getPackage().getAnnotation(a)); appendAnnotations(a, c.getSuperclass(), l); for (Class<?> c2 : c.getInterfaces()) appendAnnotations(a, c2, l); } }
/** * Finds and appends the specified annotation on the specified class and superclasses/interfaces to the specified * list. * * @param a The annotation. * @param t The class. * @param l The list of annotations. */ public static <T extends Annotation> void appendAnnotations(Class<T> a, Type t, List<T> l) { Class<?> c = toClass(t); if (c != null) { addIfNotNull(l, getDeclaredAnnotation(a, c)); if (c.getPackage() != null) addIfNotNull(l, c.getPackage().getAnnotation(a)); appendAnnotations(a, c.getSuperclass(), l); for (Class<?> c2 : c.getInterfaces()) appendAnnotations(a, c2, l); } }
List<A> l = new LinkedList<>(); if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, getter)); appendAnnotations(a, getter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, setter)); appendAnnotations(a, setter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, extraKeys)); appendAnnotations(a, extraKeys.getReturnType(), l);
List<A> l = new LinkedList<>(); if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, getter)); appendAnnotations(a, getter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, setter)); appendAnnotations(a, setter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, extraKeys)); appendAnnotations(a, extraKeys.getReturnType(), l);
List<A> l = new LinkedList<>(); if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, getter)); appendAnnotations(a, getter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, setter)); appendAnnotations(a, setter.getReturnType(), l); addIfNotNull(l, ClassUtils.getAnnotation(a, extraKeys)); appendAnnotations(a, extraKeys.getReturnType(), l);