Name
Retention
Synopsis
A
meta-annotation
of this type specifies how long the annotated annotation type should
be retained. The value( )
of this annotation type
is one of the three RetentionPolicy
enumerated
constants. See RetentionPolicy
for details. If an
annotation type does not have an @Retention
meta-annotation, its default retention is
RetentionPolicy.CLASS
.
Figure 10-80. java.lang.annotation.Retention
public @interface Retention { // Public Instance Methods RetentionPolicy value( ); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.