emul/mini/src/main/java/java/lang/annotation/RetentionPolicy.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 23 Jan 2013 20:39:23 +0100
branchemul
changeset 554 05224402145d
parent 66 emul/src/main/java/java/lang/annotation/RetentionPolicy.java@8a74b5d8d1d4
permissions -rw-r--r--
First attempt to separate 'mini' profile from the rest of JDK APIs
jaroslav@66
     1
/*
jaroslav@66
     2
 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
jaroslav@66
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@66
     4
 *
jaroslav@66
     5
 * This code is free software; you can redistribute it and/or modify it
jaroslav@66
     6
 * under the terms of the GNU General Public License version 2 only, as
jaroslav@66
     7
 * published by the Free Software Foundation.  Oracle designates this
jaroslav@66
     8
 * particular file as subject to the "Classpath" exception as provided
jaroslav@66
     9
 * by Oracle in the LICENSE file that accompanied this code.
jaroslav@66
    10
 *
jaroslav@66
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@66
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@66
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jaroslav@66
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@66
    15
 * accompanied this code).
jaroslav@66
    16
 *
jaroslav@66
    17
 * You should have received a copy of the GNU General Public License version
jaroslav@66
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@66
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@66
    20
 *
jaroslav@66
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@66
    22
 * or visit www.oracle.com if you need additional information or have any
jaroslav@66
    23
 * questions.
jaroslav@66
    24
 */
jaroslav@66
    25
jaroslav@66
    26
package java.lang.annotation;
jaroslav@66
    27
jaroslav@66
    28
/**
jaroslav@66
    29
 * Annotation retention policy.  The constants of this enumerated type
jaroslav@66
    30
 * describe the various policies for retaining annotations.  They are used
jaroslav@66
    31
 * in conjunction with the {@link Retention} meta-annotation type to specify
jaroslav@66
    32
 * how long annotations are to be retained.
jaroslav@66
    33
 *
jaroslav@66
    34
 * @author  Joshua Bloch
jaroslav@66
    35
 * @since 1.5
jaroslav@66
    36
 */
jaroslav@66
    37
public enum RetentionPolicy {
jaroslav@66
    38
    /**
jaroslav@66
    39
     * Annotations are to be discarded by the compiler.
jaroslav@66
    40
     */
jaroslav@66
    41
    SOURCE,
jaroslav@66
    42
jaroslav@66
    43
    /**
jaroslav@66
    44
     * Annotations are to be recorded in the class file by the compiler
jaroslav@66
    45
     * but need not be retained by the VM at run time.  This is the default
jaroslav@66
    46
     * behavior.
jaroslav@66
    47
     */
jaroslav@66
    48
    CLASS,
jaroslav@66
    49
jaroslav@66
    50
    /**
jaroslav@66
    51
     * Annotations are to be recorded in the class file by the compiler and
jaroslav@66
    52
     * retained by the VM at run time, so they may be read reflectively.
jaroslav@66
    53
     *
jaroslav@66
    54
     * @see java.lang.reflect.AnnotatedElement
jaroslav@66
    55
     */
jaroslav@66
    56
    RUNTIME
jaroslav@66
    57
}