darcy@1540: /* darcy@1540: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. darcy@1540: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. darcy@1540: * darcy@1540: * This code is free software; you can redistribute it and/or modify it darcy@1540: * under the terms of the GNU General Public License version 2 only, as darcy@1540: * published by the Free Software Foundation. Oracle designates this darcy@1540: * particular file as subject to the "Classpath" exception as provided darcy@1540: * by Oracle in the LICENSE file that accompanied this code. darcy@1540: * darcy@1540: * This code is distributed in the hope that it will be useful, but WITHOUT darcy@1540: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or darcy@1540: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License darcy@1540: * version 2 for more details (a copy is included in the LICENSE file that darcy@1540: * accompanied this code). darcy@1540: * darcy@1540: * You should have received a copy of the GNU General Public License version darcy@1540: * 2 along with this work; if not, write to the Free Software Foundation, darcy@1540: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. darcy@1540: * darcy@1540: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA darcy@1540: * or visit www.oracle.com if you need additional information or have any darcy@1540: * questions. darcy@1540: */ darcy@1540: darcy@1540: package jdk; darcy@1540: darcy@1540: import java.lang.annotation.*; darcy@1540: darcy@1540: /** darcy@2083: * Indicates whether or not a JDK specific type or package is an darcy@2083: * exported part of the JDK suitable for use outside of the JDK darcy@2083: * implementation itself. darcy@1540: * darcy@1540: * This annotation should only be applied to types and packages darcy@1540: * outside of the Java SE namespaces of {@code java.*} and darcy@1540: * {@code javax.*} packages. For example, certain portions of {@code darcy@1540: * com.sun.*} are official parts of the JDK meant to be generally darcy@1540: * usable while other portions of {@code com.sun.*} are not. This darcy@1540: * annotation type allows those portions to be easily and darcy@2153: * programmatically distinguished. darcy@2153: * darcy@2153: *

If in one release a type or package is darcy@2153: * @Exported(true), in a subsequent major release such a darcy@2153: * type or package can transition to @Exported(false). darcy@2153: * darcy@2153: *

If a type or package is @Exported(false) in a darcy@2153: * release, it may be removed in a subsequent major release. darcy@2153: * darcy@2153: *

If a top-level type has an @Exported annotation, darcy@2153: * any nested member types with the top-level type should have an darcy@2153: * @Exported annotation with the same value. darcy@2153: * darcy@2153: * (In exceptional cases, if a nested type is going to be removed darcy@2153: * before its enclosing type, the nested type's could be darcy@2153: * @Exported(false) while its enclosing type was darcy@2153: * @Exported(true).) darcy@2153: * darcy@2153: * Likewise, if a package has an @Exported annotation, darcy@2153: * top-level types within that package should also have an darcy@2153: * @Exported annotation. darcy@2153: * darcy@2153: * Sometimes a top-level type may have a different darcy@2153: * @Exported value than its package. darcy@1540: * darcy@1540: * @since 1.8 darcy@1540: */ darcy@1540: @Documented darcy@1540: @Retention(RetentionPolicy.RUNTIME) darcy@1540: @Target({ElementType.TYPE, ElementType.PACKAGE}) darcy@2083: @Exported darcy@2083: public @interface Exported { darcy@1540: /** darcy@2083: * Whether or not the annotated type or package is an exported part of the JDK. darcy@1540: */ darcy@1540: boolean value() default true; darcy@1540: }