Basics of Annotations – Annotations
25.1 Basics of Annotations Support for annotations is provided by the Annotation API, which is located in the java.lang.annotation package.…
25.1 Basics of Annotations Support for annotations is provided by the Annotation API, which is located in the java.lang.annotation package.…
25.2 Declaring Annotation Types An annotation type declaration specifies a new annotation type, and has a lot in common with…
Declaring Annotation Type Elements The body of an annotation type declaration may contain declarations of annotation type elements. The syntax…
Element Modifiers for Annotation Type Elements The modifiers allowed for an annotation type element are analogous to the modifiers that…
Defaults for Annotation Type Elements An annotation type element declaration can declare a default value for an element using the…
Applying Normal Annotations When a normal annotation is applied to a program element, in addition to the name of the…
Applying Marker Annotations A marker annotation is a shorthand notation typically for use with marker annotation types, which have no…
25.4 Meta-Annotations Meta-annotations are annotations that can be applied on an annotation type declaration to specify various aspects of the…
The target values of the ElementType constants from 1 to 10 in Table 25.2 indicate declaration contexts—that is, a context…
The @Target Meta-Annotation An annotation type declaration can specify the contexts in which the annotation is applicable. This is controlled…