Retention
meta-annotation interface to
specify how long annotations are to be retained.
Modifier and Type | Field and Description |
---|---|
public static final RetentionPolicy | CLASS
Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time. |
public static final RetentionPolicy | RUNTIME
Annotations are to be recorded in the class file by the compiler and retained by the VM at run time, so they may be read reflectively. |
public static final RetentionPolicy | SOURCE
Annotations are to be discarded by the compiler. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static RetentionPolicy | |
public static RetentionPolicy[] |
CLASS | back to summary |
---|---|
public static final RetentionPolicy CLASS Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time. This is the default behavior. |
RUNTIME | back to summary |
---|---|
public static final RetentionPolicy RUNTIME Annotations are to be recorded in the class file by the compiler and retained by the VM at run time, so they may be read reflectively.
|
SOURCE | back to summary |
---|---|
public static final RetentionPolicy SOURCE Annotations are to be discarded by the compiler. |
RetentionPolicy | back to summary |
---|---|
private RetentionPolicy() |
valueOf | back to summary |
---|---|
public static RetentionPolicy valueOf(String name) |
values | back to summary |
---|---|
public static RetentionPolicy[] values() |