Thu, 04 Feb 2010 10:14:28 -0800
6923080: TreeScanner.visitNewClass should scan tree.typeargs
Reviewed-by: darcy
duke@1 | 1 | /* |
duke@1 | 2 | * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@1 | 7 | * published by the Free Software Foundation. Sun designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
duke@1 | 9 | * by Sun in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
duke@1 | 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@1 | 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@1 | 23 | * have any questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package com.sun.javadoc; |
duke@1 | 27 | |
duke@1 | 28 | |
duke@1 | 29 | /** |
duke@1 | 30 | * Represents an invocation of a generic class or interface. For example, |
duke@1 | 31 | * given the generic interface {@code List<E>}, possible invocations |
duke@1 | 32 | * include: |
duke@1 | 33 | * <pre> |
duke@1 | 34 | * {@code List<String>} |
duke@1 | 35 | * {@code List<T extends Number>} |
duke@1 | 36 | * {@code List<?>} |
duke@1 | 37 | * </pre> |
duke@1 | 38 | * A generic inner class {@code Outer<T>.Inner<S>} might be invoked as: |
duke@1 | 39 | * <pre> |
duke@1 | 40 | * {@code Outer<Number>.Inner<String>} |
duke@1 | 41 | * </pre> |
duke@1 | 42 | * |
duke@1 | 43 | * @author Scott Seligman |
duke@1 | 44 | * @since 1.5 |
duke@1 | 45 | */ |
duke@1 | 46 | public interface ParameterizedType extends Type { |
duke@1 | 47 | |
duke@1 | 48 | /** |
duke@1 | 49 | * Return the generic class or interface that declared this type. |
duke@1 | 50 | * |
duke@1 | 51 | * @return the generic class or interface that declared this type. |
duke@1 | 52 | */ |
duke@1 | 53 | ClassDoc asClassDoc(); |
duke@1 | 54 | |
duke@1 | 55 | /** |
duke@1 | 56 | * Return the actual type arguments of this type. |
duke@1 | 57 | * For a generic type that is nested within some other generic type |
duke@1 | 58 | * (such as {@code Outer<T>.Inner<S>}), |
duke@1 | 59 | * only the type arguments of the innermost type are included. |
duke@1 | 60 | * |
duke@1 | 61 | * @return the actual type arguments of this type. |
duke@1 | 62 | */ |
duke@1 | 63 | Type[] typeArguments(); |
duke@1 | 64 | |
duke@1 | 65 | /** |
duke@1 | 66 | * Return the class type that is a direct supertype of this one. |
duke@1 | 67 | * This is the superclass of this type's declaring class, |
duke@1 | 68 | * with type arguments substituted in. |
duke@1 | 69 | * Return null if this is an interface type. |
duke@1 | 70 | * |
duke@1 | 71 | * <p> For example, if this parameterized type is |
duke@1 | 72 | * {@code java.util.ArrayList<String>}, the result will be |
duke@1 | 73 | * {@code java.util.AbstractList<String>}. |
duke@1 | 74 | * |
duke@1 | 75 | * @return the class type that is a direct supertype of this one. |
duke@1 | 76 | */ |
duke@1 | 77 | Type superclassType(); |
duke@1 | 78 | |
duke@1 | 79 | /** |
duke@1 | 80 | * Return the interface types directly implemented by or extended by this |
duke@1 | 81 | * parameterized type. |
duke@1 | 82 | * These are the interfaces directly implemented or extended |
duke@1 | 83 | * by this type's declaring class or interface, |
duke@1 | 84 | * with type arguments substituted in. |
duke@1 | 85 | * Return an empty array if there are no interfaces. |
duke@1 | 86 | * |
duke@1 | 87 | * <p> For example, the interface extended by |
duke@1 | 88 | * {@code java.util.Set<String>} is {@code java.util.Collection<String>}. |
duke@1 | 89 | * |
duke@1 | 90 | * @return the interface types directly implemented by or extended by this |
duke@1 | 91 | * parameterized type. |
duke@1 | 92 | */ |
duke@1 | 93 | Type[] interfaceTypes(); |
duke@1 | 94 | |
duke@1 | 95 | /** |
duke@1 | 96 | * Return the type that contains this type as a member. |
duke@1 | 97 | * Return null is this is a top-level type. |
duke@1 | 98 | * |
duke@1 | 99 | * <p> For example, the containing type of |
duke@1 | 100 | * {@code AnInterface.Nested<Number>} is the <code>ClassDoc</code> |
duke@1 | 101 | * representing {@code AnInterface}, and the containing type of |
duke@1 | 102 | * {@code Outer<String>.Inner<Number>} is the |
duke@1 | 103 | * <code>ParameterizedType</code> representing {@code Outer<String>}. |
duke@1 | 104 | * |
duke@1 | 105 | * @return the type that contains this type as a member. |
duke@1 | 106 | */ |
duke@1 | 107 | Type containingType(); |
duke@1 | 108 | } |