Class AnnotationUtils


  • public final class AnnotationUtils
    extends java.lang.Object
    A utility class for annotations
    Since:
    1.11
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <A extends java.lang.annotation.Annotation>
      A
      getAnnotation​(java.lang.Object objectOrClass, java.lang.Class<A> annotationClass)
      Searches for a class annotation.
      static <A> A getClassAnnotation​(java.lang.Object object, java.lang.Class<A> annotationClass)
      Deprecated.
      As of 3.1, replaced by getAnnotation(Object,Class)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAnnotation

        public static <A extends java.lang.annotation.Annotation> A getAnnotation​(java.lang.Object objectOrClass,
                                                                                  java.lang.Class<A> annotationClass)
        Searches for a class annotation. All inheritance tree is analysed.
        Since:
        3.1
      • getClassAnnotation

        @Deprecated
        public static <A> A getClassAnnotation​(java.lang.Object object,
                                               java.lang.Class<A> annotationClass)
        Deprecated.
        As of 3.1, replaced by getAnnotation(Object,Class)
        Searches for a class annotation. All inheritance tree is analysed.