Interface AnnotatedElement

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T extends Annotation>
      T
      getAnnotation​(Class<T> annotationType)
      Returns, for this element, the annotation with the specified type, or null if no annotation with the specified type is present (including inherited annotations).
      Annotation[] getAnnotations()
      Returns, for this element, an array containing all annotations (including inherited annotations).
      Annotation[] getDeclaredAnnotations()
      Returns, for this element, all annotations that are explicitly declared (not inherited).
      boolean isAnnotationPresent​(Class<? extends Annotation> annotationType)
      Indicates whether or not this element has an annotation with the specified annotation type (including inherited annotations).
    • Method Detail

      • getAnnotation

        <T extends Annotation> T getAnnotation​(Class<T> annotationType)
        Returns, for this element, the annotation with the specified type, or null if no annotation with the specified type is present (including inherited annotations).
        Parameters:
        annotationType - the type of the annotation to search for
        Returns:
        the annotation with the specified type or null
        Throws:
        NullPointerException - if annotationType is null
      • getAnnotations

        Annotation[] getAnnotations()
        Returns, for this element, an array containing all annotations (including inherited annotations). If there are no annotations present, this method returns a zero length array.
        Returns:
        an array of all annotations for this element
      • getDeclaredAnnotations

        Annotation[] getDeclaredAnnotations()
        Returns, for this element, all annotations that are explicitly declared (not inherited). If there are no declared annotations present, this method returns a zero length array.
        Returns:
        an array of annotations declared for this element
      • isAnnotationPresent

        boolean isAnnotationPresent​(Class<? extends Annotation> annotationType)
        Indicates whether or not this element has an annotation with the specified annotation type (including inherited annotations).
        Parameters:
        annotationType - the type of the annotation to search for
        Returns:
        true if the annotation exists, false otherwise
        Throws:
        NullPointerException - if annotationType is null