src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 35302 jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java@e4d2275861c3
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     1
/*
31139
d48c3edf6a55 8054304: Clarify treatment of bounds in j.l.r.Annotated{WildcardType,TypeVariable}.
sadayapalam
parents: 25859
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     4
 *
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    10
 *
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    15
 * accompanied this code).
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    16
 *
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    20
 *
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    23
 * questions.
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    24
 */
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    25
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    26
package java.lang.reflect;
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    27
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    28
/**
20481
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    29
 * {@code AnnotatedWildcardType} represents the potentially annotated use of a
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    30
 * wildcard type argument, whose upper or lower bounds may themselves represent
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    31
 * annotated uses of types.
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    32
 *
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    33
 * @since 1.8
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    34
 */
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    35
public interface AnnotatedWildcardType extends AnnotatedType {
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    36
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    37
    /**
20481
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    38
     * Returns the potentially annotated lower bounds of this wildcard type.
31177
c8ceef082391 8098790: Improve cross references and wording in java.lang.reflect.AnnotatedFoo type
darcy
parents: 31139
diff changeset
    39
     * If no lower bound is explicitly declared, the lower bound is the
31139
d48c3edf6a55 8054304: Clarify treatment of bounds in j.l.r.Annotated{WildcardType,TypeVariable}.
sadayapalam
parents: 25859
diff changeset
    40
     * type of null. In this case, a zero length array is returned.
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    41
     *
31139
d48c3edf6a55 8054304: Clarify treatment of bounds in j.l.r.Annotated{WildcardType,TypeVariable}.
sadayapalam
parents: 25859
diff changeset
    42
     * @return the potentially annotated lower bounds of this wildcard type or
d48c3edf6a55 8054304: Clarify treatment of bounds in j.l.r.Annotated{WildcardType,TypeVariable}.
sadayapalam
parents: 25859
diff changeset
    43
     * an empty array if no lower bound is explicitly declared.
31177
c8ceef082391 8098790: Improve cross references and wording in java.lang.reflect.AnnotatedFoo type
darcy
parents: 31139
diff changeset
    44
     * @see WildcardType#getLowerBounds()
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    45
     */
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    46
    AnnotatedType[] getAnnotatedLowerBounds();
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    47
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    48
    /**
20481
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    49
     * Returns the potentially annotated upper bounds of this wildcard type.
31177
c8ceef082391 8098790: Improve cross references and wording in java.lang.reflect.AnnotatedFoo type
darcy
parents: 31139
diff changeset
    50
     * If no upper bound is explicitly declared, the upper bound is
31139
d48c3edf6a55 8054304: Clarify treatment of bounds in j.l.r.Annotated{WildcardType,TypeVariable}.
sadayapalam
parents: 25859
diff changeset
    51
     * unannotated {@code Object}
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    52
     *
20481
2735b307d256 8007072: Update Core Reflection for Type Annotations to match latest spec
jfranck
parents: 15510
diff changeset
    53
     * @return the potentially annotated upper bounds of this wildcard type
31177
c8ceef082391 8098790: Improve cross references and wording in java.lang.reflect.AnnotatedFoo type
darcy
parents: 31139
diff changeset
    54
     * @see WildcardType#getUpperBounds()
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    55
     */
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    56
    AnnotatedType[] getAnnotatedUpperBounds();
34708
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    57
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    58
    /**
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    59
     * Returns the potentially annotated type that this type is a member of, if
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    60
     * this type represents a nested type. For example, if this type is
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    61
     * {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    62
     *
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    63
     * <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    64
     *     of {@code AnnotatedWildcardType}.
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    65
     *
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    66
     * @return {@code null}
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    67
     *
35302
e4d2275861c3 8136494: Update "@since 1.9" to "@since 9" to match java.version.specification
iris
parents: 34708
diff changeset
    68
     * @since 9
34708
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    69
     */
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    70
    @Override
4a1e3728135c 8057804: AnnotatedType interfaces provide no way to get annotations on owner type
jfranck
parents: 31177
diff changeset
    71
    AnnotatedType getAnnotatedOwnerType();
15510
898d924a7efd 8004698: Implement Core Reflection for Type Annotations
jfranck
parents:
diff changeset
    72
}