src/share/classes/jdk/Exported.java

Wed, 08 Oct 2014 14:16:40 -0700

author
asaha
date
Wed, 08 Oct 2014 14:16:40 -0700
changeset 2586
f5e5ca7505e2
parent 2153
b82982ac3ca2
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Merge

darcy@1540 1 /*
darcy@1540 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
darcy@1540 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
darcy@1540 4 *
darcy@1540 5 * This code is free software; you can redistribute it and/or modify it
darcy@1540 6 * under the terms of the GNU General Public License version 2 only, as
darcy@1540 7 * published by the Free Software Foundation. Oracle designates this
darcy@1540 8 * particular file as subject to the "Classpath" exception as provided
darcy@1540 9 * by Oracle in the LICENSE file that accompanied this code.
darcy@1540 10 *
darcy@1540 11 * This code is distributed in the hope that it will be useful, but WITHOUT
darcy@1540 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
darcy@1540 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
darcy@1540 14 * version 2 for more details (a copy is included in the LICENSE file that
darcy@1540 15 * accompanied this code).
darcy@1540 16 *
darcy@1540 17 * You should have received a copy of the GNU General Public License version
darcy@1540 18 * 2 along with this work; if not, write to the Free Software Foundation,
darcy@1540 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
darcy@1540 20 *
darcy@1540 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
darcy@1540 22 * or visit www.oracle.com if you need additional information or have any
darcy@1540 23 * questions.
darcy@1540 24 */
darcy@1540 25
darcy@1540 26 package jdk;
darcy@1540 27
darcy@1540 28 import java.lang.annotation.*;
darcy@1540 29
darcy@1540 30 /**
darcy@2083 31 * Indicates whether or not a JDK specific type or package is an
darcy@2083 32 * exported part of the JDK suitable for use outside of the JDK
darcy@2083 33 * implementation itself.
darcy@1540 34 *
darcy@1540 35 * This annotation should only be applied to types and packages
darcy@1540 36 * <em>outside</em> of the Java SE namespaces of {@code java.*} and
darcy@1540 37 * {@code javax.*} packages. For example, certain portions of {@code
darcy@1540 38 * com.sun.*} are official parts of the JDK meant to be generally
darcy@1540 39 * usable while other portions of {@code com.sun.*} are not. This
darcy@1540 40 * annotation type allows those portions to be easily and
darcy@2153 41 * programmatically distinguished.
darcy@2153 42 *
darcy@2153 43 * <p>If in one release a type or package is
darcy@2153 44 * <code>@Exported(true)</code>, in a subsequent major release such a
darcy@2153 45 * type or package can transition to <code>@Exported(false)</code>.
darcy@2153 46 *
darcy@2153 47 * <p>If a type or package is <code>@Exported(false)</code> in a
darcy@2153 48 * release, it may be removed in a subsequent major release.
darcy@2153 49 *
darcy@2153 50 * <p>If a top-level type has an <code>@Exported</code> annotation,
darcy@2153 51 * any nested member types with the top-level type should have an
darcy@2153 52 * <code>@Exported</code> annotation with the same value.
darcy@2153 53 *
darcy@2153 54 * (In exceptional cases, if a nested type is going to be removed
darcy@2153 55 * before its enclosing type, the nested type's could be
darcy@2153 56 * <code>@Exported(false)</code> while its enclosing type was
darcy@2153 57 * <code>@Exported(true)</code>.)
darcy@2153 58 *
darcy@2153 59 * Likewise, if a package has an <code>@Exported</code> annotation,
darcy@2153 60 * top-level types within that package should also have an
darcy@2153 61 * <code>@Exported</code> annotation.
darcy@2153 62 *
darcy@2153 63 * Sometimes a top-level type may have a different
darcy@2153 64 * <code>@Exported</code> value than its package.
darcy@1540 65 *
darcy@1540 66 * @since 1.8
darcy@1540 67 */
darcy@1540 68 @Documented
darcy@1540 69 @Retention(RetentionPolicy.RUNTIME)
darcy@1540 70 @Target({ElementType.TYPE, ElementType.PACKAGE})
darcy@2083 71 @Exported
darcy@2083 72 public @interface Exported {
darcy@1540 73 /**
darcy@2083 74 * Whether or not the annotated type or package is an exported part of the JDK.
darcy@1540 75 */
darcy@1540 76 boolean value() default true;
darcy@1540 77 }

mercurial