author | ksrini |
Fri, 09 Feb 2018 13:58:17 -0800 | |
changeset 48840 | 5e2d2067da48 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.javadoc; |
|
27 |
||
28 |
/** |
|
29 |
* Represents a type. A type can be a class or interface, an |
|
30 |
* invocation (like {@code List<String>}) of a generic class or interface, |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
31 |
* a type variable, a wildcard type ("{@code ?}"), |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
32 |
* or a primitive data type (like {@code char}). |
10 | 33 |
* |
34 |
* @since 1.2 |
|
35 |
* @author Kaiyang Liu (original) |
|
36 |
* @author Robert Field (rewrite) |
|
37 |
* @author Scott Seligman (generics) |
|
38617 | 38 |
* |
39 |
* @deprecated |
|
40 |
* The declarations in this package have been superseded by those |
|
41 |
* in the package {@code jdk.javadoc.doclet}. |
|
42 |
* For more information, see the <i>Migration Guide</i> in the documentation for that package. |
|
10 | 43 |
*/ |
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
44 |
@Deprecated(since="9", forRemoval=true) |
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
45 |
@SuppressWarnings("removal") |
10 | 46 |
public interface Type { |
47 |
||
48 |
/** |
|
49 |
* Return unqualified name of type excluding any dimension information. |
|
50 |
* <p> |
|
51 |
* For example, a two dimensional array of String returns |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
52 |
* "{@code String}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
53 |
* @return unqualified name of type excluding any dimension information. |
10 | 54 |
*/ |
55 |
String typeName(); |
|
56 |
||
57 |
/** |
|
58 |
* Return qualified name of type excluding any dimension information. |
|
59 |
*<p> |
|
60 |
* For example, a two dimensional array of String |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
61 |
* returns "{@code java.lang.String}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
62 |
* @return qualified name of this type excluding any dimension information. |
10 | 63 |
*/ |
64 |
String qualifiedTypeName(); |
|
65 |
||
66 |
/** |
|
67 |
* Return the simple name of this type excluding any dimension information. |
|
68 |
* This is the unqualified name of the type, except that for nested types |
|
69 |
* only the identifier of the innermost type is included. |
|
70 |
* <p> |
|
71 |
* For example, the class {@code Outer.Inner} returns |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
72 |
* "{@code Inner}". |
10 | 73 |
* |
74 |
* @since 1.5 |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
75 |
* @return the simple name of this type excluding any dimension information. |
10 | 76 |
*/ |
77 |
String simpleTypeName(); |
|
78 |
||
79 |
/** |
|
80 |
* Return the type's dimension information, as a string. |
|
81 |
* <p> |
|
82 |
* For example, a two dimensional array of String returns |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
83 |
* "{@code [][]}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
84 |
* @return the type's dimension information as a string. |
10 | 85 |
*/ |
86 |
String dimension(); |
|
87 |
||
88 |
/** |
|
89 |
* Return a string representation of the type. |
|
90 |
* This includes any dimension information and type arguments. |
|
91 |
* <p> |
|
92 |
* For example, a two dimensional array of String may return |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
93 |
* "{@code java.lang.String[][]}", |
10 | 94 |
* and the parameterized type {@code List<Integer>} may return |
95 |
* "{@code java.util.List<java.lang.Integer>}". |
|
96 |
* |
|
97 |
* @return a string representation of the type. |
|
98 |
*/ |
|
99 |
String toString(); |
|
100 |
||
101 |
/** |
|
102 |
* Return true if this type represents a primitive type. |
|
103 |
* |
|
104 |
* @return true if this type represents a primitive type. |
|
105 |
* @since 1.5 |
|
106 |
*/ |
|
107 |
boolean isPrimitive(); |
|
108 |
||
109 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
110 |
* Return this type as a {@code ClassDoc} if it represents a class |
10 | 111 |
* or interface. Array dimensions are ignored. |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
112 |
* If this type is a {@code ParameterizedType}, |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
113 |
* {@code TypeVariable}, or {@code WildcardType}, return |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
114 |
* the {@code ClassDoc} of the type's erasure. If this is an |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
115 |
* {@code AnnotationTypeDoc}, return this as a {@code ClassDoc} |
10 | 116 |
* (but see {@link #asAnnotationTypeDoc()}). |
117 |
* If this is a primitive type, return null. |
|
118 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
119 |
* @return the {@code ClassDoc} of this type, |
10 | 120 |
* or null if it is a primitive type. |
121 |
*/ |
|
122 |
ClassDoc asClassDoc(); |
|
123 |
||
124 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
125 |
* Return this type as a {@code ParameterizedType} if it represents |
10 | 126 |
* an invocation of a generic class or interface. Array dimensions |
127 |
* are ignored. |
|
128 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
129 |
* @return a {@code ParameterizedType} if the type is an |
10 | 130 |
* invocation of a generic type, or null if it is not. |
131 |
* @since 1.5 |
|
132 |
*/ |
|
133 |
ParameterizedType asParameterizedType(); |
|
134 |
||
135 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
136 |
* Return this type as a {@code TypeVariable} if it represents |
10 | 137 |
* a type variable. Array dimensions are ignored. |
138 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
139 |
* @return a {@code TypeVariable} if the type is a type variable, |
10 | 140 |
* or null if it is not. |
141 |
* @since 1.5 |
|
142 |
*/ |
|
143 |
TypeVariable asTypeVariable(); |
|
144 |
||
145 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
146 |
* Return this type as a {@code WildcardType} if it represents |
10 | 147 |
* a wildcard type. |
148 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
149 |
* @return a {@code WildcardType} if the type is a wildcard type, |
10 | 150 |
* or null if it is not. |
151 |
* @since 1.5 |
|
152 |
*/ |
|
153 |
WildcardType asWildcardType(); |
|
154 |
||
155 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
156 |
* Returns this type as a {@code AnnotatedType} if it represents |
15385 | 157 |
* an annotated type. |
158 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
159 |
* @return a {@code AnnotatedType} if the type if an annotated type, |
15385 | 160 |
* or null if it is not |
161 |
* @since 1.8 |
|
162 |
*/ |
|
163 |
AnnotatedType asAnnotatedType(); |
|
164 |
||
165 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
166 |
* Return this type as an {@code AnnotationTypeDoc} if it represents |
10 | 167 |
* an annotation type. Array dimensions are ignored. |
168 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
169 |
* @return an {@code AnnotationTypeDoc} if the type is an annotation |
10 | 170 |
* type, or null if it is not. |
171 |
* @since 1.5 |
|
172 |
*/ |
|
173 |
AnnotationTypeDoc asAnnotationTypeDoc(); |
|
16969
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
174 |
|
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
175 |
/** |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
176 |
* If this type is an array type, return the element type of the |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
177 |
* array. Otherwise, return null. |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
178 |
* |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
179 |
* @return a {@code Type} representing the element type or null. |
16969
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
180 |
* @since 1.8 |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
181 |
*/ |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
182 |
Type getElementType(); |
10 | 183 |
} |