Path: blob/master/src/java.base/share/classes/jdk/internal/javac/PreviewFeature.java
67848 views
/*1* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package jdk.internal.javac;2627import java.lang.annotation.*;2829/**30* Indicates the API declaration in question is associated with a31* <em>preview feature</em>. See JEP 12: "Preview Language and VM32* Features" (http://openjdk.java.net/jeps/12).33*34* Note this internal annotation is handled specially by the javac compiler.35* To work properly with {@code --release older-release}, it requires special36* handling in {@code make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java}37* and {@code src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java}.38*39* @since 1440*/41// Match the meaningful targets of java.lang.Deprecated, omit local42// variables and parameter declarations43@Target({ElementType.METHOD,44ElementType.CONSTRUCTOR,45ElementType.FIELD,46ElementType.PACKAGE,47ElementType.MODULE,48ElementType.TYPE})49// CLASS retention will hopefully be sufficient for the purposes at hand50@Retention(RetentionPolicy.CLASS)51// *Not* @Documented52public @interface PreviewFeature {53/**54* Name of the preview feature the annotated API is associated55* with.56*/57public Feature feature();5859public boolean reflective() default false;6061public enum Feature {62/*63* This one can only be removed after JDK 1764*/65SEALED_CLASSES,66SWITCH_PATTERN_MATCHING,67/**68* A key for testing.69*/70TEST,71;72}73}747576