One: meta-annotations in Java annotationsFour meta-annotations are: @Target, @Retention, @Documented, @Inherited,again, the following meta-annotations are provided by the Java API and are specifically used to define annotations, as follows: @Target indicates where the annotation is used, and the possible values are in the enumeration class Elemenettype, including: elemenettype.constructor----------------------------Builder Declaration elemenettype.field-------------------------------------- Domain declarations (including enum instances) elemenettype.local_ VARIABLE-------------------------local variable declaration Elemenettype.method----------------------------------Method Declaration elemenettype.package---------------------------------Package Declaration elemenettype.parameter------------------------------Parameter Declaration elemenettype.type---------------------------------------class, Interfaces (including annotation types) or enum declarations @Retention indicates at what level the annotation information is saved. The optional parameter values are in the enumeration type Retentionpolicy, including the: Retentionpolicy.source---------------------------------annotations will be discarded by the compiler retentionpolicy.class-----------------------------------annotations are available in the CLASS file, but are discarded by the VM retentionpolicy.runtime VM-------will also retain comments at run time, The information of the annotations can therefore be read through the reflection mechanism. @ Documented includes this annotation in Javadoc, which means that the annotation is extracted as a document by the Javadoc tool. The content in the Doc document differs depending on the content of the information for this annotation. quite with @see, @param and so on. @Inherited allows subclasses to inherit annotations from the parent class.
Meta-Annotations in Java annotations