/** * Returns all instances of the specified annotation on the specified class. * * <p> * Searches all superclasses and superinterfaces. * Results are ordered child-to-parent. * * @param <T> The annotation class type. * @param a The annotation class type. * @param t The class being searched. * @return The found matches, or an empty array if annotation was not found. */ public static <T extends Annotation> List<T> getAnnotations(Class<T> a, Type t) { List<T> l = new LinkedList<>(); appendAnnotations(a, t, l); return l; }
/** * Returns all instances of the specified annotation on the specified class. * * <p> * Searches all superclasses and superinterfaces. * Results are ordered child-to-parent. * * @param <T> The annotation class type. * @param a The annotation class type. * @param t The class being searched. * @return The found matches, or an empty array if annotation was not found. */ public static <T extends Annotation> List<T> getAnnotations(Class<T> a, Type t) { List<T> l = new LinkedList<>(); appendAnnotations(a, t, l); return l; }
/** * Returns all instances of the specified annotation on the specified class. * * <p> * Searches all superclasses and superinterfaces. * Results are ordered child-to-parent. * * @param <T> The annotation class type. * @param a The annotation class type. * @param t The class being searched. * @return The found matches, or an empty array if annotation was not found. */ public static <T extends Annotation> List<T> getAnnotations(Class<T> a, Type t) { List<T> l = new LinkedList<>(); appendAnnotations(a, t, l); return 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); } }
Type t = m.getGenericReturnType(); if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, l);
Type t = m.getGenericReturnType(); if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, l);
Type t = m.getGenericReturnType(); if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, l);
Type t = m.getGenericParameterTypes()[index]; if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, l);
Type t = m.getGenericParameterTypes()[index]; if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, l);
Type t = m.getGenericParameterTypes()[index]; if (Value.isType(t)) appendAnnotations(a, Value.getParameterType(t), l); else appendAnnotations(a, t, 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); } }
if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); appendAnnotations(a, getter.getReturnType(), l); appendAnnotations(a, setter.getReturnType(), l); appendAnnotations(a, extraKeys.getReturnType(), l); appendAnnotations(a, this.getBeanMeta().getClassMeta().getInnerClass(), l); return l;
if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); appendAnnotations(a, getter.getReturnType(), l); appendAnnotations(a, setter.getReturnType(), l); appendAnnotations(a, extraKeys.getReturnType(), l); appendAnnotations(a, this.getBeanMeta().getClassMeta().getInnerClass(), l); return l;
if (field != null) { addIfNotNull(l, field.getAnnotation(a)); appendAnnotations(a, field.getType(), l); appendAnnotations(a, getter.getReturnType(), l); appendAnnotations(a, setter.getReturnType(), l); appendAnnotations(a, extraKeys.getReturnType(), l); appendAnnotations(a, this.getBeanMeta().getClassMeta().getInnerClass(), l); return l;