Interface HasAnnotations

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T extends java.lang.annotation.Annotation>
      T
      getAnnotation​(java.lang.Class<T> annotationClass)
      Returns an instance of the specified annotation type if it is present on this element or null if it is not.
      java.lang.annotation.Annotation[] getAnnotations()
      Returns all the annotations present on this element.
      java.lang.annotation.Annotation[] getDeclaredAnnotations()
      Returns the annotations declared directly on this element; does not include any inherited annotations.
      boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
      Returns true if this item has an annotation of the specified type.
    • Method Detail

      • getAnnotation

        <T extends java.lang.annotation.Annotation> T getAnnotation​(java.lang.Class<T> annotationClass)
        Returns an instance of the specified annotation type if it is present on this element or null if it is not. For a class, this will look for annotations on supertypes as well.
        Parameters:
        annotationClass - annotation type to search for
        Returns:
        instance of the specified annotation type if it is present on this element or null if it is not
      • getAnnotations

        java.lang.annotation.Annotation[] getAnnotations()
        Returns all the annotations present on this element. For a class, the list will include annotations on supertypes as well.
      • getDeclaredAnnotations

        java.lang.annotation.Annotation[] getDeclaredAnnotations()
        Returns the annotations declared directly on this element; does not include any inherited annotations.
      • isAnnotationPresent

        boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
        Returns true if this item has an annotation of the specified type. For a class, this will look at supertypes as well.
        Returns:
        true if this item has an annotation of the specified type