Uses of Interface
java.lang.annotation.Annotation

Packages that use Annotation
Package
Description
Contains classes related to developing beans -- components based on the JavaBeans architecture.
Provides for system input and output through data streams, serialization and the file system.
Provides classes that are fundamental to the design of the Java programming language.
Provides library support for the Java programming language annotation facility.
Provides classes and interfaces for obtaining reflective information about classes and objects.
Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.
Types and hierarchies of packages comprising a Java language model, a model of the declarations and types of the Java programming language.
Interfaces used to model elements of the Java programming language.
Interfaces used to model Java programming language types.
Provides the core classes for the Java Management Extensions.
Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
This package provides classes to create events and control Flight Recorder.
  • Uses of Annotation in java.beans

    Classes in java.beans that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    An annotation used to specify some property-related information for the automatically generated BeanInfo classes.
    @interface 
    An annotation on a constructor that shows how the parameters of that constructor correspond to the constructed object's getter methods.
    @interface 
    An annotation used to specify some class-related information for the automatically generated BeanInfo classes.
    @interface 
    Indicates that an attribute called "transient" should be declared with the given value when the Introspector constructs a PropertyDescriptor or EventSetDescriptor classes associated with the annotated code element.
  • Uses of Annotation in java.io

    Classes in java.io that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    Indicates that an annotated field or method is part of the serialization mechanism defined by the Java Object Serialization Specification.
  • Uses of Annotation in java.lang

    Classes in java.lang that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    A program element annotated @Deprecated is one that programmers are discouraged from using.
    @interface 
    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 
    Indicates that a method declaration is intended to override a method declaration in a supertype.
    @interface 
    A programmer assertion that the body of the annotated method or constructor does not perform potentially unsafe operations on its varargs parameter.
    @interface 
    Indicates the warnings to be suppressed at compile time in the annotated element, and in all elements contained in the annotated element.
    Methods in java.lang with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A
    Class.getAnnotation(Class<A> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is present, else null.
    <T extends Annotation>
    T
    Module.getAnnotation(Class<T> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is present, else null.
    <A extends Annotation>
    A
    Package.getAnnotation(Class<A> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is present, else null.
    <A extends Annotation>
    A[]
    Class.getAnnotationsByType(Class<A> annotationClass)
    Returns annotations that are associated with this element.
    <A extends Annotation>
    A[]
    Package.getAnnotationsByType(Class<A> annotationClass)
    Returns annotations that are associated with this element.
    <A extends Annotation>
    A
    Class.getDeclaredAnnotation(Class<A> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is directly present, else null.
    <A extends Annotation>
    A
    Package.getDeclaredAnnotation(Class<A> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is directly present, else null.
    <A extends Annotation>
    A[]
    Class.getDeclaredAnnotationsByType(Class<A> annotationClass)
    Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    <A extends Annotation>
    A[]
    Package.getDeclaredAnnotationsByType(Class<A> annotationClass)
     
    Methods in java.lang that return Annotation
    Modifier and Type
    Method
    Description
    Returns annotations that are present on this element.
    Returns annotations that are present on this element.
    Package.getAnnotations()
    Returns annotations that are present on this element.
    <A extends Annotation>
    A[]
    Class.getAnnotationsByType(Class<A> annotationClass)
    Returns annotations that are associated with this element.
    <A extends Annotation>
    A[]
    Package.getAnnotationsByType(Class<A> annotationClass)
    Returns annotations that are associated with this element.
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    <A extends Annotation>
    A[]
    Class.getDeclaredAnnotationsByType(Class<A> annotationClass)
    Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    <A extends Annotation>
    A[]
    Package.getDeclaredAnnotationsByType(Class<A> annotationClass)
     
    Method parameters in java.lang with type arguments of type Annotation
    Modifier and Type
    Method
    Description
    boolean
    Class.isAnnotationPresent(Class<? extends Annotation> annotationClass)
    Returns true if an annotation for the specified type is present on this element, else false.
    boolean
    Package.isAnnotationPresent(Class<? extends Annotation> annotationClass)
    Returns true if an annotation for the specified type is present on this element, else false.
  • Uses of Annotation in java.lang.annotation

    Classes in java.lang.annotation that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    If the annotation @Documented is present on the declaration of an annotation interface A, then any @A annotation on an element is considered part of the element's public contract.
    @interface 
    Indicates that an annotation interface is automatically inherited.
    @interface 
    Indicates that a field defining a constant value may be referenced from native code.
    @interface 
    The annotation interface java.lang.annotation.Repeatable is used to indicate that the annotation interface whose declaration it (meta-)annotates is repeatable.
    @interface 
    Indicates how long annotations with the annotated interface are to be retained.
    @interface 
    Indicates the contexts in which an annotation interface is applicable.
    Methods in java.lang.annotation that return types with arguments of type Annotation
    Modifier and Type
    Method
    Description
    Class<? extends Annotation>
    Annotation.annotationType()
    Returns the annotation interface of this annotation.
    Class<? extends Annotation>
    IncompleteAnnotationException.annotationType()
    Returns the Class object for the annotation interface with the missing element.
    Constructor parameters in java.lang.annotation with type arguments of type Annotation
    Modifier
    Constructor
    Description
     
    IncompleteAnnotationException(Class<? extends Annotation> annotationType, String elementName)
    Constructs an IncompleteAnnotationException to indicate that the named element was missing from the specified annotation interface.
  • Uses of Annotation in java.lang.reflect

    Methods in java.lang.reflect with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <T extends Annotation>
    T
    AccessibleObject.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
    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
    AnnotatedType.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
    Constructor.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
    Executable.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
    Field.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
    Method.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
    Parameter.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
    RecordComponent.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.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    default <T extends Annotation>
    T[]
    AnnotatedElement.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Executable.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Field.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Parameter.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T
    AccessibleObject.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.getDeclaredAnnotation(Class<T> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is directly present, else null.
    <T extends Annotation>
    T
    Parameter.getDeclaredAnnotation(Class<T> annotationClass)
    Returns this element's annotation for the specified type if such an annotation is directly present, else null.
    <T extends Annotation>
    T[]
    AccessibleObject.getDeclaredAnnotationsByType(Class<T> annotationClass)
    Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    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.
    <T extends Annotation>
    T[]
    Parameter.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
    Description
    AccessibleObject.getAnnotations()
    Returns annotations that are present on this element.
    AnnotatedElement.getAnnotations()
    Returns annotations that are present on this element.
    AnnotatedType.getAnnotations()
    Returns annotations that are present on this element.
    Parameter.getAnnotations()
    Returns annotations that are present on this element.
    RecordComponent.getAnnotations()
    Returns annotations that are present on this element.
    <T extends Annotation>
    T[]
    AccessibleObject.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    default <T extends Annotation>
    T[]
    AnnotatedElement.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Executable.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Field.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    <T extends Annotation>
    T[]
    Parameter.getAnnotationsByType(Class<T> annotationClass)
    Returns annotations that are associated with this element.
    AccessibleObject.getDeclaredAnnotations()
    Returns annotations that are directly present on this element.
    AnnotatedElement.getDeclaredAnnotations()
    Returns annotations that are directly present on this element.
    AnnotatedType.getDeclaredAnnotations()
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    Returns annotations that are directly present on this element.
    RecordComponent.getDeclaredAnnotations()
    Returns annotations that are directly present on this element.
    <T extends Annotation>
    T[]
    AccessibleObject.getDeclaredAnnotationsByType(Class<T> annotationClass)
    Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    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.
    <T extends Annotation>
    T[]
    Parameter.getDeclaredAnnotationsByType(Class<T> annotationClass)
    Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present.
    Returns an array of arrays of Annotations that represent the annotations on the formal parameters, in declaration order, of the Executable represented by this object.
    abstract Annotation[][]
    Returns an array of arrays of Annotations that represent the annotations on the formal parameters, in declaration order, of the Executable represented by this object.
    Returns an array of arrays of Annotations that represent the annotations on the formal parameters, in declaration order, of the Executable represented by this object.
    Method parameters in java.lang.reflect with type arguments of type Annotation
    Modifier and Type
    Method
    Description
    boolean
    AccessibleObject.isAnnotationPresent(Class<? extends Annotation> annotationClass)
    Returns true if an annotation for the specified type is present on this element, else false.
    default boolean
    AnnotatedElement.isAnnotationPresent(Class<? extends Annotation> annotationClass)
    Returns true if an annotation for the specified type is present on this element, else false.
  • Uses of Annotation in javax.annotation.processing

    Classes in javax.annotation.processing that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    The Generated annotation is used to mark source code that has been generated.
    @interface 
    An annotation used to indicate what annotation interfaces an annotation processor supports.
    @interface 
    An annotation used to indicate what options an annotation processor supports.
    @interface 
    An annotation used to indicate the latest source version an annotation processor supports.
    Method parameters in javax.annotation.processing with type arguments of type Annotation
    Modifier and Type
    Method
    Description
    Set<? extends Element>
    RoundEnvironment.getElementsAnnotatedWith(Class<? extends Annotation> a)
    Returns the elements annotated with the given annotation interface.
    default Set<? extends Element>
    RoundEnvironment.getElementsAnnotatedWithAny(Set<Class<? extends Annotation>> annotations)
    Returns the elements annotated with one or more of the given annotation interfaces.
  • Uses of Annotation in javax.lang.model

    Methods in javax.lang.model with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A
    AnnotatedConstruct.getAnnotation(Class<A> annotationType)
    Returns this construct's annotation of the specified type if such an annotation is present, else null.
    <A extends Annotation>
    A[]
    AnnotatedConstruct.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
    Methods in javax.lang.model that return Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A[]
    AnnotatedConstruct.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
  • Uses of Annotation in javax.lang.model.element

    Methods in javax.lang.model.element with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A
    Element.getAnnotation(Class<A> annotationType)
    Returns this construct's annotation of the specified type if such an annotation is present, else null.
    <A extends Annotation>
    A[]
    Element.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
    Methods in javax.lang.model.element that return Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A[]
    Element.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
  • Uses of Annotation in javax.lang.model.type

    Methods in javax.lang.model.type with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A
    TypeMirror.getAnnotation(Class<A> annotationType)
    Returns this construct's annotation of the specified type if such an annotation is present, else null.
    <A extends Annotation>
    A[]
    TypeMirror.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
    Methods in javax.lang.model.type that return Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A[]
    TypeMirror.getAnnotationsByType(Class<A> annotationType)
    Returns annotations that are associated with this construct.
  • Uses of Annotation in javax.management

    Classes in javax.management that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    An annotation on a constructor that shows how the parameters of that constructor correspond to the constructed object's getter methods.
    @interface 
    Meta-annotation that describes how an annotation element relates to a field in a Descriptor.
    @interface 
    Annotation to mark an interface explicitly as being an MXBean interface, or as not being an MXBean interface.
  • Uses of Annotation in javax.swing

    Classes in javax.swing that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    An annotation used to specify some swing-related information for the automatically generated BeanInfo classes.
  • Uses of Annotation in jdk.jfr

    Classes in jdk.jfr that implement Annotation
    Modifier and Type
    Class
    Description
    @interface 
    Event field annotation, specifies that the value is a boolean flag, a true or false value.
    @interface 
    Event annotation, to associate the event type with a category, in the format of a human-readable path.
    @interface 
    Meta annotation, specifies that an annotation represents a content type, such as a time span or a frequency.
    @interface 
    Event field annotation, specifies that a value represents an amount of data (for example, bytes).
    @interface 
    Annotation that describes an element by using a sentence or two.
    @interface 
    Event annotation, determines if an event should be enabled by default.
    @interface 
    Annotation that specifies that an element is experimental and may change without notice.
    @interface 
    Event field annotation, specifies that the value is a frequency, measured in Hz.
    @interface 
    Annotation that sets a human-readable name for an element (for example, "Maximum Throughput").
    @interface 
    Event field annotation, specifies that the value is a memory address.
    @interface 
    Meta annotation for defining new types of event metadata.
    @interface 
    Annotation that sets the default name for an element.
    @interface 
    Event field annotation to use on fractions, typically between 0.0 and 1.0, to specify that the value is a percentage.
    @interface 
    Event annotation, specifies the default setting value for a periodic event.
    @interface 
    Event annotation, for programmatic event registration.
    @interface 
    Meta annotation for relational annotations, to be used on an annotation.
    @interface 
    Annotation that specifies that a method in an event class should be used to filter out events.
    @interface 
    Event annotation, determines whether an event by default has a stack trace or not.
    @interface 
    Event annotation, specifies the default duration below which an event is not recorded (for example, "20 ms").
    @interface 
    Event field annotation, specifies that the value is a duration.
    @interface 
    Event field annotation, specifies that the value is a point in time.
    @interface 
    Event field annotation, specifies that the event transitioned from a thread.
    @interface 
    Event field annotation, specifies that the event will soon transition to a thread.
    @interface 
    Event field annotation, specifies that the value is of an unsigned data type.
    Methods in jdk.jfr with type parameters of type Annotation
    Modifier and Type
    Method
    Description
    <A extends Annotation>
    A
    EventType.getAnnotation(Class<A> annotationClass)
    Returns the first annotation for the specified type if an annotation element with the same name is directly present, otherwise null.
    <A extends Annotation>
    A
    SettingDescriptor.getAnnotation(Class<A> annotationType)
    Returns the first annotation for the specified type if an annotation element with the same name is available, null otherwise.
    <A extends Annotation>
    A
    ValueDescriptor.getAnnotation(Class<A> annotationType)
    Returns the first annotation for the specified type if an annotation element with the same name is directly present for this value descriptor, null otherwise.
    Method parameters in jdk.jfr with type arguments of type Annotation
    Modifier and Type
    Method
    Description
    final <A> A
    AnnotationElement.getAnnotation(Class<? extends Annotation> annotationType)
    Returns the first annotation for the specified type if an AnnotationElement with the same name exists, else null.
    Constructor parameters in jdk.jfr with type arguments of type Annotation
    Modifier
    Constructor
    Description
     
    AnnotationElement(Class<? extends Annotation> annotationType)
    Creates an annotation element to use for dynamically defined events.
     
    AnnotationElement(Class<? extends Annotation> annotationType, Object value)
    Creates an annotation element to use for dynamically defined events.
     
    AnnotationElement(Class<? extends Annotation> annotationType, Map<String,Object> values)
    Creates an annotation element to use for dynamically defined events.