## Uses of Interface
java.lang.annotation.Annotation

- Packages that use Annotation
  Package | Description
  --- | ---
  java.lang |
  java.lang.annotation |
  java.lang.reflect | Provides classes and interfaces for obtaining reflective information about classes and objects.

- - ### Uses of Annotation in java.lang

    Classes in java.lang that implement Annotation
    Modifier and Type | Class and Description
    --- | ---
    `interface` | `Deprecated` A program element annotated @Deprecated is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists.
    `interface` | `FunctionalInterface` An informative annotation type used to indicate that an interface type declaration is intended to be a functional interface as defined by the Java Language Specification.
    `interface` | `Override` Indicates that a method declaration is intended to override a method declaration in a supertype.

    Methods in java.lang with type parameters of type Annotation
    Modifier and Type | Method and Description
    --- | ---
    `<A extends Annotation> A` | Class.`getAnnotation(Class<A> annotationClass)`

    Methods in java.lang that return Annotation
    Modifier and Type | Method and Description
    --- | ---
    `Annotation[]` | Class.`getAnnotations()`
    `Annotation[]` | Class.`getDeclaredAnnotations()`

    Method parameters in java.lang with type arguments of type Annotation
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | Class.`isAnnotationPresent(Class<? extends Annotation> annotationClass)`

  - ### Uses of Annotation in java.lang.annotation

    Classes in java.lang.annotation that implement Annotation
    Modifier and Type | Class and Description
    --- | ---
    `interface` | `Documented` Indicates that annotations with a type are to be documented by javadoc and similar tools by default.
    `interface` | `Retention` Indicates how long annotations with the annotated type are to be retained.
    `interface` | `Target` Indicates the kinds of program element to which an annotation type is applicable.

    Methods in java.lang.annotation that return types with arguments of type Annotation
    Modifier and Type | Method and Description
    --- | ---
    `Class<? extends Annotation>` | Annotation.`annotationType()` Returns the annotation type of this annotation.

  - ### Uses of Annotation in java.lang.reflect

    Methods in java.lang.reflect with type parameters of type Annotation
    Modifier and Type | Method and Description
    --- | ---
    `<T extends Annotation> T` | Method.`getAnnotation(Class<T> annotationClass)`
    `<T extends Annotation> T` | Field.`getAnnotation(Class<T> annotationClass)`
    `<T extends Annotation> T` | Constructor.`getAnnotation(Class<T> annotationClass)`
    `<T extends Annotation> T` | AnnotatedElement.`getAnnotation(Class<T> annotationClass)` Returns this element's annotation for the specified type if such an annotation is present, else null.
    `<T extends Annotation> T` | AccessibleObject.`getAnnotation(Class<T> annotationClass)`
    `default <T extends Annotation> T[]` | AnnotatedElement.`getAnnotationsByType(Class<T> annotationClass)` Returns annotations that are associated with this element.
    `default <T extends Annotation> T` | AnnotatedElement.`getDeclaredAnnotation(Class<T> annotationClass)` Returns this element's annotation for the specified type if such an annotation is directly present, else null.
    `default <T extends Annotation> T[]` | AnnotatedElement.`getDeclaredAnnotationsByType(Class<T> annotationClass)` Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.

    Methods in java.lang.reflect that return Annotation
    Modifier and Type | Method and Description
    --- | ---
    `Annotation[]` | AnnotatedElement.`getAnnotations()` Returns annotations that are present on this element.
    `Annotation[]` | AccessibleObject.`getAnnotations()`
    `default <T extends Annotation> T[]` | AnnotatedElement.`getAnnotationsByType(Class<T> annotationClass)` Returns annotations that are associated with this element.
    `Annotation[]` | Method.`getDeclaredAnnotations()`
    `Annotation[]` | Field.`getDeclaredAnnotations()`
    `Annotation[]` | Constructor.`getDeclaredAnnotations()`
    `Annotation[]` | AnnotatedElement.`getDeclaredAnnotations()` Returns annotations that are directly present on this element.
    `Annotation[]` | AccessibleObject.`getDeclaredAnnotations()`
    `default <T extends Annotation> T[]` | AnnotatedElement.`getDeclaredAnnotationsByType(Class<T> annotationClass)` Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    `Annotation[][]` | Method.`getParameterAnnotations()` Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of the method represented by this `Method` object.
    `Annotation[][]` | Constructor.`getParameterAnnotations()` Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of the method represented by this `Constructor` object.

    Method parameters in java.lang.reflect with type arguments of type Annotation
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | AnnotatedElement.`isAnnotationPresent(Class<? extends Annotation> annotationClass)` Returns true if an annotation for the specified type is present on this element, else false.
    `boolean` | AccessibleObject.`isAnnotationPresent(Class<? extends Annotation> annotationClass)`

Copyright © 2025 API Design. All Rights Reserved.