KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > annotation > RetentionPolicy


1 /*
2  * @(#)RetentionPolicy.java 1.4 04/02/03
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang.annotation;
9
10 /**
11  * Annotation retention policy. The constants of this enumerated type
12  * describe the various policies for retaining annotations. They are used
13  * in conjunction with the {@link Retention} meta-annotation type to specify
14  * how long annotations are to be retained.
15  *
16  * @author Joshua Bloch
17  * @since 1.5
18  */

19 public enum RetentionPolicy {
20     /**
21      * Annotations are to be discarded by the compiler.
22      */

23     SOURCE,
24
25     /**
26      * Annotations are to be recorded in the class file by the compiler
27      * but need not be retained by the VM at run time. This is the default
28      * behavior.
29      */

30     CLASS,
31
32     /**
33      * Annotations are to be recorded in the class file by the compiler and
34      * retained by the VM at run time, so they may be read reflectively.
35      *
36      * @see java.lang.reflect.AnnotatedElement
37      */

38     RUNTIME
39 }
40
Popular Tags