jdk-21-ga : jdk-22+36
Module java.compiler
Package javax.lang.model

Interface AnnotatedConstruct

public abstract interface AnnotatedConstruct
Comparing jdk-21-ga and jdk-22+36
All Known Subinterfaces:
ArrayType , DeclaredType , Element , ErrorType , ExecutableElement , ExecutableType , IntersectionType , ModuleElement , NoType , NullType , PackageElement , Parameterizable , PrimitiveType , QualifiedNameable , RecordComponentElement , ReferenceType , TypeElement , TypeMirror , TypeParameterElement , TypeVariable , UnionType , VariableElement , WildcardType

public interface AnnotatedConstruct
Represents a construct that can be annotated. A construct is either an element or a type. Annotations on an element are on a declaration , whereas annotations on a type are on a specific use of a type name. As defined by The Java Language Specification section Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7.4.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.7.4.9.7.4, an annotation on an element is a declaration annotation and an annotation on a type is a type annotation . The terms directly present , present , indirectly present , and associated are used throughout this interface to describe precisely which annotations, either declaration annotations or type annotations, are returned by the methods in this interface.

In the definitions below, an annotation A has an annotation interface AI. If AI is a repeatable annotation interface, the type of the containing annotation is AIC.

Annotation A is directly present on a construct C if either:

An annotation A is present on a construct C if either:

  • A is directly present on C.
  • No annotation of type AI is directly present on C, and C is a class and AI is inheritable and A is present on the superclass of C.

An annotation A is indirectly present on a construct C if both:

  • AI is a repeatable annotation interface with a containing annotation interface AIC.
  • An annotation of type AIC is directly present on C and A is an annotation included in the result of calling the value method of the directly present annotation of type AIC.

An annotation A is associated with a construct C if either:

  • A is directly or indirectly present on C.
  • No annotation of type AI is directly or indirectly present on C, and C is a class, and AI is inheritable, and A is associated with the superclass of C.
See Java Language Specification:
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.6.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.6. Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.6.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.6.9.6 Annotation Interfaces
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.6.4.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.6.4.3.9.6.4.3 Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.6.4.3.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.6.4.3.@Inherited
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7.4.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.7.4.9.7.4 Where Annotations May Appear
Moved out of a link with destination https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7.5.Moved to a link with destination https://docs.oracle.com/javase/specs/jls/se22/html/jls-9.html#jls-9.7.5.9.7.5 Multiple Annotations of the Same Interface
Since:
1.8

Methods

Summary

Differences
Elements Comments Descriptions Total
Added Changed Removed Added Changed Removed Added Changed Removed
AnnotatedConstruct 8 8
getAnnotation(Class) 1 1
getAnnotationsByType(Class) 2 2
Total 11 11