author | jjg |
Fri, 27 May 2016 13:06:58 -0700 | |
changeset 38617 | d93a7f64e231 |
parent 25874 | 83c19f00452c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
2 |
* Copyright (c) 1997, 2014, 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 |
*/ |
38617 | 44 |
@Deprecated |
10 | 45 |
public interface Type { |
46 |
||
47 |
/** |
|
48 |
* Return unqualified name of type excluding any dimension information. |
|
49 |
* <p> |
|
50 |
* 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
|
51 |
* "{@code String}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
52 |
* @return unqualified name of type excluding any dimension information. |
10 | 53 |
*/ |
54 |
String typeName(); |
|
55 |
||
56 |
/** |
|
57 |
* Return qualified name of type excluding any dimension information. |
|
58 |
*<p> |
|
59 |
* For example, a two dimensional array of String |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
60 |
* returns "{@code java.lang.String}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
61 |
* @return qualified name of this type excluding any dimension information. |
10 | 62 |
*/ |
63 |
String qualifiedTypeName(); |
|
64 |
||
65 |
/** |
|
66 |
* Return the simple name of this type excluding any dimension information. |
|
67 |
* This is the unqualified name of the type, except that for nested types |
|
68 |
* only the identifier of the innermost type is included. |
|
69 |
* <p> |
|
70 |
* For example, the class {@code Outer.Inner} returns |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
71 |
* "{@code Inner}". |
10 | 72 |
* |
73 |
* @since 1.5 |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
74 |
* @return the simple name of this type excluding any dimension information. |
10 | 75 |
*/ |
76 |
String simpleTypeName(); |
|
77 |
||
78 |
/** |
|
79 |
* Return the type's dimension information, as a string. |
|
80 |
* <p> |
|
81 |
* 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
|
82 |
* "{@code [][]}". |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
83 |
* @return the type's dimension information as a string. |
10 | 84 |
*/ |
85 |
String dimension(); |
|
86 |
||
87 |
/** |
|
88 |
* Return a string representation of the type. |
|
89 |
* This includes any dimension information and type arguments. |
|
90 |
* <p> |
|
91 |
* 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
|
92 |
* "{@code java.lang.String[][]}", |
10 | 93 |
* and the parameterized type {@code List<Integer>} may return |
94 |
* "{@code java.util.List<java.lang.Integer>}". |
|
95 |
* |
|
96 |
* @return a string representation of the type. |
|
97 |
*/ |
|
98 |
String toString(); |
|
99 |
||
100 |
/** |
|
101 |
* Return true if this type represents a primitive type. |
|
102 |
* |
|
103 |
* @return true if this type represents a primitive type. |
|
104 |
* @since 1.5 |
|
105 |
*/ |
|
106 |
boolean isPrimitive(); |
|
107 |
||
108 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
109 |
* Return this type as a {@code ClassDoc} if it represents a class |
10 | 110 |
* or interface. Array dimensions are ignored. |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
111 |
* If this type is a {@code ParameterizedType}, |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
112 |
* {@code TypeVariable}, or {@code WildcardType}, return |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
113 |
* 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
|
114 |
* {@code AnnotationTypeDoc}, return this as a {@code ClassDoc} |
10 | 115 |
* (but see {@link #asAnnotationTypeDoc()}). |
116 |
* If this is a primitive type, return null. |
|
117 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
118 |
* @return the {@code ClassDoc} of this type, |
10 | 119 |
* or null if it is a primitive type. |
120 |
*/ |
|
121 |
ClassDoc asClassDoc(); |
|
122 |
||
123 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
124 |
* Return this type as a {@code ParameterizedType} if it represents |
10 | 125 |
* an invocation of a generic class or interface. Array dimensions |
126 |
* are ignored. |
|
127 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
128 |
* @return a {@code ParameterizedType} if the type is an |
10 | 129 |
* invocation of a generic type, or null if it is not. |
130 |
* @since 1.5 |
|
131 |
*/ |
|
132 |
ParameterizedType asParameterizedType(); |
|
133 |
||
134 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
135 |
* Return this type as a {@code TypeVariable} if it represents |
10 | 136 |
* a type variable. Array dimensions are ignored. |
137 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
138 |
* @return a {@code TypeVariable} if the type is a type variable, |
10 | 139 |
* or null if it is not. |
140 |
* @since 1.5 |
|
141 |
*/ |
|
142 |
TypeVariable asTypeVariable(); |
|
143 |
||
144 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
145 |
* Return this type as a {@code WildcardType} if it represents |
10 | 146 |
* a wildcard type. |
147 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
148 |
* @return a {@code WildcardType} if the type is a wildcard type, |
10 | 149 |
* or null if it is not. |
150 |
* @since 1.5 |
|
151 |
*/ |
|
152 |
WildcardType asWildcardType(); |
|
153 |
||
154 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
155 |
* Returns this type as a {@code AnnotatedType} if it represents |
15385 | 156 |
* an annotated type. |
157 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
158 |
* @return a {@code AnnotatedType} if the type if an annotated type, |
15385 | 159 |
* or null if it is not |
160 |
* @since 1.8 |
|
161 |
*/ |
|
162 |
AnnotatedType asAnnotatedType(); |
|
163 |
||
164 |
/** |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
165 |
* Return this type as an {@code AnnotationTypeDoc} if it represents |
10 | 166 |
* an annotation type. Array dimensions are ignored. |
167 |
* |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
168 |
* @return an {@code AnnotationTypeDoc} if the type is an annotation |
10 | 169 |
* type, or null if it is not. |
170 |
* @since 1.5 |
|
171 |
*/ |
|
172 |
AnnotationTypeDoc asAnnotationTypeDoc(); |
|
16969
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
173 |
|
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 |
* 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
|
176 |
* array. Otherwise, return null. |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
177 |
* |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
16969
diff
changeset
|
178 |
* @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
|
179 |
* @since 1.8 |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
180 |
*/ |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
181 |
Type getElementType(); |
10 | 182 |
} |