Class AnnotationIntrospector


  • public class AnnotationIntrospector
    extends Object
    Various utils for performing runtime introspection on annotations.
    Version:
    $Revision$
    Author:
    Julien Viet
    • Constructor Detail

      • AnnotationIntrospector

        public AnnotationIntrospector()
    • Method Detail

      • resolveClassAnnotations

        public static <A extends Annotation> A resolveClassAnnotations​(Class<?> clazz,
                                                                       Class<A> classAnnotation)
                                                                throws IllegalArgumentException
        Resolve an annotation of the specified class and its inheritance hierarchy. If no such annotation cannot be resolved then null is returned.
        Type Parameters:
        A - the annotation class
        Parameters:
        clazz - the examined class
        classAnnotation - the annotation to lookup
        Returns:
        the annotation
        Throws:
        IllegalArgumentException - if any argument is null
      • resolveMethodAnnotations

        public static <A extends AnnotationMap<Method,​A> resolveMethodAnnotations​(Class<?> clazz,
                                                                                          Class<A> methodAnnotation)