author | mli |
Wed, 23 May 2018 14:21:14 +0800 | |
changeset 50230 | cae567ae015d |
parent 49415 | 56a5f899e882 |
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) 1998, 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 |
/** |
|
30 |
* Represents a java class or interface and provides access to |
|
31 |
* information about the class, the class's comment and tags, and the |
|
32 |
* members of the class. A ClassDoc only exists if it was |
|
33 |
* processed in this run of javadoc. References to classes |
|
34 |
* which may or may not have been processed in this run are |
|
35 |
* referred to using Type (which can be converted to ClassDoc, |
|
36 |
* if possible). |
|
37 |
* |
|
38 |
* @see Type |
|
39 |
* |
|
40 |
* @since 1.2 |
|
41 |
* @author Kaiyang Liu (original) |
|
42 |
* @author Robert Field (rewrite) |
|
38617 | 43 |
* |
44 |
* @deprecated |
|
45 |
* The declarations in this package have been superseded by those |
|
46 |
* in the package {@code jdk.javadoc.doclet}. |
|
47 |
* For more information, see the <i>Migration Guide</i> in the documentation for that package. |
|
10 | 48 |
*/ |
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
49 |
@Deprecated(since="9", forRemoval=true) |
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
50 |
@SuppressWarnings("removal") |
10 | 51 |
public interface ClassDoc extends ProgramElementDoc, Type { |
52 |
||
53 |
/** |
|
54 |
* Return true if this class is abstract. Return true |
|
55 |
* for all interfaces. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
56 |
* |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
57 |
* @return true if this class is abstract. Return true |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
58 |
* for all interfaces. |
10 | 59 |
*/ |
60 |
boolean isAbstract(); |
|
61 |
||
62 |
/** |
|
63 |
* Return true if this class implements or interface extends |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
64 |
* {@code java.io.Serializable}. |
10 | 65 |
* |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
66 |
* Since {@code java.io.Externalizable} extends |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
67 |
* {@code java.io.Serializable}, |
10 | 68 |
* Externalizable objects are also Serializable. |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
69 |
* |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
70 |
* @return true if this class implements or interface extends |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
71 |
* {@code java.io.Serializable}. |
10 | 72 |
*/ |
73 |
boolean isSerializable(); |
|
74 |
||
75 |
/** |
|
76 |
* Return true if this class implements or interface extends |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
77 |
* {@code java.io.Externalizable}. |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
78 |
* |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
79 |
* @return true if this class implements or interface extends |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
80 |
* {@code java.io.Externalizable}. |
10 | 81 |
*/ |
82 |
boolean isExternalizable(); |
|
83 |
||
84 |
/** |
|
85 |
* Return the serialization methods for this class or |
|
86 |
* interface. |
|
87 |
* |
|
88 |
* @return an array of MethodDoc objects that represents |
|
89 |
* the serialization methods for this class or interface. |
|
90 |
*/ |
|
91 |
MethodDoc[] serializationMethods(); |
|
92 |
||
93 |
/** |
|
94 |
* Return the Serializable fields of this class or interface. |
|
95 |
* <p> |
|
96 |
* Return either a list of default fields documented by |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
97 |
* {@code serial} tag<br> |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
98 |
* or return a single {@code FieldDoc} for |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
99 |
* {@code serialPersistentField} member. |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
100 |
* There should be a {@code serialField} tag for |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
101 |
* each Serializable field defined by an {@code ObjectStreamField} |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
102 |
* array component of {@code serialPersistentField}. |
10 | 103 |
* |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
104 |
* @return an array of {@code FieldDoc} objects for the Serializable |
10 | 105 |
* fields of this class or interface. |
106 |
* |
|
107 |
* @see #definesSerializableFields() |
|
108 |
* @see SerialFieldTag |
|
109 |
*/ |
|
110 |
FieldDoc[] serializableFields(); |
|
111 |
||
112 |
/** |
|
113 |
* Return true if Serializable fields are explicitly defined with |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
114 |
* the special class member {@code serialPersistentFields}. |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
115 |
* |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
116 |
* @return true if Serializable fields are explicitly defined with |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
117 |
* the special class member {@code serialPersistentFields}. |
10 | 118 |
* |
119 |
* @see #serializableFields() |
|
120 |
* @see SerialFieldTag |
|
121 |
*/ |
|
122 |
boolean definesSerializableFields(); |
|
123 |
||
124 |
/** |
|
125 |
* Return the superclass of this class. Return null if this is an |
|
126 |
* interface. |
|
127 |
* |
|
128 |
* <p> <i>This method cannot accommodate certain generic type constructs. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
129 |
* The {@code superclassType} method should be used instead.</i> |
10 | 130 |
* |
131 |
* @return the ClassDoc for the superclass of this class, null if |
|
132 |
* there is no superclass. |
|
133 |
* @see #superclassType |
|
134 |
*/ |
|
135 |
ClassDoc superclass(); |
|
136 |
||
137 |
/** |
|
138 |
* Return the superclass of this class. Return null if this is an |
|
139 |
* interface. A superclass is represented by either a |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
140 |
* {@code ClassDoc} or a {@code ParametrizedType}. |
10 | 141 |
* |
142 |
* @return the superclass of this class, or null if there is no superclass. |
|
143 |
* @since 1.5 |
|
144 |
*/ |
|
145 |
Type superclassType(); |
|
146 |
||
147 |
/** |
|
148 |
* Test whether this class is a subclass of the specified class. |
|
149 |
* If this is an interface, return false for all classes except |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
150 |
* {@code java.lang.Object} (we must keep this unexpected |
10 | 151 |
* behavior for compatibility reasons). |
152 |
* |
|
153 |
* @param cd the candidate superclass. |
|
154 |
* @return true if cd is a superclass of this class. |
|
155 |
*/ |
|
156 |
boolean subclassOf(ClassDoc cd); |
|
157 |
||
158 |
/** |
|
159 |
* Return interfaces implemented by this class or interfaces extended |
|
160 |
* by this interface. Includes only directly-declared interfaces, not |
|
161 |
* inherited interfaces. |
|
162 |
* Return an empty array if there are no interfaces. |
|
163 |
* |
|
164 |
* <p> <i>This method cannot accommodate certain generic type constructs. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
165 |
* The {@code interfaceTypes} method should be used instead.</i> |
10 | 166 |
* |
167 |
* @return an array of ClassDoc objects representing the interfaces. |
|
168 |
* @see #interfaceTypes |
|
169 |
*/ |
|
170 |
ClassDoc[] interfaces(); |
|
171 |
||
172 |
/** |
|
173 |
* Return interfaces implemented by this class or interfaces extended |
|
174 |
* by this interface. Includes only directly-declared interfaces, not |
|
175 |
* inherited interfaces. |
|
176 |
* Return an empty array if there are no interfaces. |
|
177 |
* |
|
178 |
* @return an array of interfaces, each represented by a |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
179 |
* {@code ClassDoc} or a {@code ParametrizedType}. |
10 | 180 |
* @since 1.5 |
181 |
*/ |
|
182 |
Type[] interfaceTypes(); |
|
183 |
||
184 |
/** |
|
185 |
* Return the formal type parameters of this class or interface. |
|
186 |
* Return an empty array if there are none. |
|
187 |
* |
|
188 |
* @return the formal type parameters of this class or interface. |
|
189 |
* @since 1.5 |
|
190 |
*/ |
|
191 |
TypeVariable[] typeParameters(); |
|
192 |
||
193 |
/** |
|
194 |
* Return the type parameter tags of this class or interface. |
|
195 |
* Return an empty array if there are none. |
|
196 |
* |
|
197 |
* @return the type parameter tags of this class or interface. |
|
198 |
* @since 1.5 |
|
199 |
*/ |
|
200 |
ParamTag[] typeParamTags(); |
|
201 |
||
202 |
/** |
|
203 |
* Return |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
204 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">included</a> |
10 | 205 |
* fields in this class or interface. |
206 |
* Excludes enum constants if this is an enum type. |
|
207 |
* |
|
208 |
* @return an array of FieldDoc objects representing the included |
|
209 |
* fields in this class or interface. |
|
210 |
*/ |
|
211 |
FieldDoc[] fields(); |
|
212 |
||
213 |
/** |
|
214 |
* Return fields in this class or interface, filtered to the specified |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
215 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">access |
10 | 216 |
* modifier option</a>. |
217 |
* Excludes enum constants if this is an enum type. |
|
218 |
* |
|
219 |
* @param filter Specify true to filter according to the specified access |
|
220 |
* modifier option. |
|
221 |
* Specify false to include all fields regardless of |
|
222 |
* access modifier option. |
|
223 |
* @return an array of FieldDoc objects representing the included |
|
224 |
* fields in this class or interface. |
|
225 |
*/ |
|
226 |
FieldDoc[] fields(boolean filter); |
|
227 |
||
228 |
/** |
|
229 |
* Return the enum constants if this is an enum type. |
|
230 |
* Return an empty array if there are no enum constants, or if |
|
231 |
* this is not an enum type. |
|
232 |
* |
|
233 |
* @return the enum constants if this is an enum type. |
|
234 |
*/ |
|
235 |
FieldDoc[] enumConstants(); |
|
236 |
||
237 |
/** |
|
238 |
* Return |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
239 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">included</a> |
10 | 240 |
* methods in this class or interface. |
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
241 |
* Same as {@code methods(true)}. |
10 | 242 |
* |
243 |
* @return an array of MethodDoc objects representing the included |
|
244 |
* methods in this class or interface. Does not include |
|
245 |
* constructors or annotation type elements. |
|
246 |
*/ |
|
247 |
MethodDoc[] methods(); |
|
248 |
||
249 |
/** |
|
250 |
* Return methods in this class or interface, filtered to the specified |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
251 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">access |
10 | 252 |
* modifier option</a>. Does not include constructors or annotation |
253 |
* type elements. |
|
254 |
* |
|
255 |
* @param filter Specify true to filter according to the specified access |
|
256 |
* modifier option. |
|
257 |
* Specify false to include all methods regardless of |
|
258 |
* access modifier option. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
259 |
* |
10 | 260 |
* @return an array of MethodDoc objects representing the included |
261 |
* methods in this class or interface. |
|
262 |
*/ |
|
263 |
MethodDoc[] methods(boolean filter); |
|
264 |
||
265 |
/** |
|
266 |
* Return |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
267 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">included</a> |
10 | 268 |
* constructors in this class. An array containing the default |
269 |
* no-arg constructor is returned if no other constructors exist. |
|
270 |
* Return empty array if this is an interface. |
|
271 |
* |
|
272 |
* @return an array of ConstructorDoc objects representing the included |
|
273 |
* constructors in this class. |
|
274 |
*/ |
|
275 |
ConstructorDoc[] constructors(); |
|
276 |
||
277 |
/** |
|
278 |
* Return constructors in this class, filtered to the specified |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
279 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">access |
10 | 280 |
* modifier option</a>. Return an array containing the default |
281 |
* no-arg constructor if no other constructors exist. |
|
282 |
* |
|
283 |
* @param filter Specify true to filter according to the specified access |
|
284 |
* modifier option. |
|
285 |
* Specify false to include all constructors regardless of |
|
286 |
* access modifier option. |
|
287 |
* @return an array of ConstructorDoc objects representing the included |
|
288 |
* constructors in this class. |
|
289 |
*/ |
|
290 |
ConstructorDoc[] constructors(boolean filter); |
|
291 |
||
292 |
||
293 |
/** |
|
294 |
* Return |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
295 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">included</a> |
10 | 296 |
* nested classes and interfaces within this class or interface. |
297 |
* This includes both static and non-static nested classes. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
298 |
* (This method should have been named {@code nestedClasses()}, |
10 | 299 |
* as inner classes are technically non-static.) Anonymous and local classes |
300 |
* or interfaces are not included. |
|
301 |
* |
|
302 |
* @return an array of ClassDoc objects representing the included classes |
|
303 |
* and interfaces defined in this class or interface. |
|
304 |
*/ |
|
305 |
ClassDoc[] innerClasses(); |
|
306 |
||
307 |
/** |
|
308 |
* Return nested classes and interfaces within this class or interface |
|
309 |
* filtered to the specified |
|
49415
56a5f899e882
8199902: {@docRoot} references need to be updated to reflect new module/package structure
jjg
parents:
48840
diff
changeset
|
310 |
* <a href="{@docRoot}/jdk.javadoc/com/sun/javadoc/package-summary.html#included">access |
10 | 311 |
* modifier option</a>. |
312 |
* This includes both static and non-static nested classes. |
|
313 |
* Anonymous and local classes are not included. |
|
314 |
* |
|
315 |
* @param filter Specify true to filter according to the specified access |
|
316 |
* modifier option. |
|
317 |
* Specify false to include all nested classes regardless of |
|
318 |
* access modifier option. |
|
319 |
* @return a filtered array of ClassDoc objects representing the included |
|
320 |
* classes and interfaces defined in this class or interface. |
|
321 |
*/ |
|
322 |
ClassDoc[] innerClasses(boolean filter); |
|
323 |
||
324 |
/** |
|
325 |
* Find the specified class or interface within the context of this class doc. |
|
326 |
* Search order: 1) qualified name, 2) nested in this class or interface, |
|
327 |
* 3) in this package, 4) in the class imports, 5) in the package imports. |
|
328 |
* Return the ClassDoc if found, null if not found. |
|
23136
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
329 |
* @param className Specify the class name to find as a String. |
aa8958a4c8f4
8035877: javadoc classes are missing @return and @param tags
jjg
parents:
14951
diff
changeset
|
330 |
* @return the ClassDoc if found, null if not found. |
10 | 331 |
*/ |
332 |
ClassDoc findClass(String className); |
|
333 |
||
334 |
/** |
|
335 |
* Get the list of classes and interfaces declared as imported. |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
336 |
* These are called "single-type-import declarations" in |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
337 |
* <cite>The Java™ Language Specification</cite>. |
10 | 338 |
* |
339 |
* @return an array of ClassDoc representing the imported classes. |
|
340 |
* |
|
341 |
* @deprecated Import declarations are implementation details that |
|
342 |
* should not be exposed here. In addition, not all imported |
|
343 |
* classes are imported through single-type-import declarations. |
|
344 |
*/ |
|
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
345 |
@Deprecated(since="9", forRemoval=true) |
10 | 346 |
ClassDoc[] importedClasses(); |
347 |
||
348 |
/** |
|
349 |
* Get the list of packages declared as imported. |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
350 |
* These are called "type-import-on-demand declarations" in |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
351 |
* <cite>The Java™ Language Specification</cite>. |
10 | 352 |
* |
353 |
* @return an array of PackageDoc representing the imported packages. |
|
354 |
* |
|
355 |
* @deprecated Import declarations are implementation details that |
|
356 |
* should not be exposed here. In addition, this method's |
|
357 |
* return type does not allow for all type-import-on-demand |
|
358 |
* declarations to be returned. |
|
359 |
*/ |
|
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
360 |
@Deprecated(since="9", forRemoval=true) |
10 | 361 |
PackageDoc[] importedPackages(); |
362 |
} |