public final enum

RetentionPolicy

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ java.lang.annotation.RetentionPolicy

Class Overview

Annotation retention policy. The constants of this enumerated type describe the various policies for retaining annotations. They are used in conjunction with the Retention meta-annotation type to specify how long annotations are to be retained.

Summary

Enum Values
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. 
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. 
RetentionPolicy  SOURCE  Annotations are to be discarded by the compiler. 
Public Methods
static RetentionPolicy valueOf(String name)
final static RetentionPolicy[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

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.

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.

See Also

public static final RetentionPolicy SOURCE

Annotations are to be discarded by the compiler.

Public Methods

public static RetentionPolicy valueOf (String name)

public static final RetentionPolicy[] values ()