1 |
779 |
jeremybenn |
/* ClassDoc.java -- Document a Java class or interface
|
2 |
|
|
Copyright (C) 1999 Free Software Foundation, Inc.
|
3 |
|
|
|
4 |
|
|
This file is part of GNU Classpath.
|
5 |
|
|
|
6 |
|
|
GNU Classpath is free software; you can redistribute it and/or modify
|
7 |
|
|
it under the terms of the GNU General Public License as published by
|
8 |
|
|
the Free Software Foundation; either version 2, or (at your option)
|
9 |
|
|
any later version.
|
10 |
|
|
|
11 |
|
|
GNU Classpath is distributed in the hope that it will be useful, but
|
12 |
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
General Public License for more details.
|
15 |
|
|
|
16 |
|
|
You should have received a copy of the GNU General Public License
|
17 |
|
|
along with GNU Classpath; see the file COPYING. If not, write to the
|
18 |
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
19 |
|
|
02110-1301 USA.
|
20 |
|
|
|
21 |
|
|
Linking this library statically or dynamically with other modules is
|
22 |
|
|
making a combined work based on this library. Thus, the terms and
|
23 |
|
|
conditions of the GNU General Public License cover the whole
|
24 |
|
|
combination.
|
25 |
|
|
|
26 |
|
|
As a special exception, the copyright holders of this library give you
|
27 |
|
|
permission to link this library with independent modules to produce an
|
28 |
|
|
executable, regardless of the license terms of these independent
|
29 |
|
|
modules, and to copy and distribute the resulting executable under
|
30 |
|
|
terms of your choice, provided that you also meet, for each linked
|
31 |
|
|
independent module, the terms and conditions of the license of that
|
32 |
|
|
module. An independent module is a module which is not derived from
|
33 |
|
|
or based on this library. If you modify this library, you may extend
|
34 |
|
|
this exception to your version of the library, but you are not
|
35 |
|
|
obligated to do so. If you do not wish to do so, delete this
|
36 |
|
|
exception statement from your version. */
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
package com.sun.javadoc;
|
40 |
|
|
|
41 |
|
|
public interface ClassDoc extends ProgramElementDoc, Type
|
42 |
|
|
{
|
43 |
|
|
|
44 |
|
|
/**
|
45 |
|
|
* This method tests whether or not the class represented by this object
|
46 |
|
|
* is abstract.
|
47 |
|
|
*
|
48 |
|
|
* @return <code>true</code> if the class is abstract, <code>false</code>,
|
49 |
|
|
* otherwise.
|
50 |
|
|
*/
|
51 |
|
|
public abstract boolean
|
52 |
|
|
isAbstract();
|
53 |
|
|
|
54 |
|
|
/*************************************************************************/
|
55 |
|
|
|
56 |
|
|
/**
|
57 |
|
|
* This method tests whether or not the class represented by this object
|
58 |
|
|
* is serializable. That is, whether or not the class implements the
|
59 |
|
|
* <code>java.io.Serializable</code> interface. This includes classes
|
60 |
|
|
* which are externalizable.
|
61 |
|
|
*
|
62 |
|
|
* @return <code>true</code> if the class is serializable,
|
63 |
|
|
* <code>false</code> otherwise.
|
64 |
|
|
*/
|
65 |
|
|
public abstract boolean
|
66 |
|
|
isSerializable();
|
67 |
|
|
|
68 |
|
|
/*************************************************************************/
|
69 |
|
|
|
70 |
|
|
/**
|
71 |
|
|
* This method tests whether or not the class represented by this object
|
72 |
|
|
* is externalizable. That is, whether or not the class implements the
|
73 |
|
|
* <code>java.io.Externalizable</code> interface.
|
74 |
|
|
*
|
75 |
|
|
* @return <code>true</code> if the class is externalizable,
|
76 |
|
|
* <code>false</code> otherwise.
|
77 |
|
|
*/
|
78 |
|
|
public abstract boolean
|
79 |
|
|
isExternalizable();
|
80 |
|
|
|
81 |
|
|
/*************************************************************************/
|
82 |
|
|
|
83 |
|
|
/**
|
84 |
|
|
* This method returns the serialization methods for the class
|
85 |
|
|
* represented by this object. Is the custom readObject/writeObject
|
86 |
|
|
* methods?
|
87 |
|
|
*
|
88 |
|
|
* @return The serialization methods for this class.
|
89 |
|
|
*/
|
90 |
|
|
public abstract MethodDoc[]
|
91 |
|
|
serializationMethods();
|
92 |
|
|
|
93 |
|
|
/*************************************************************************/
|
94 |
|
|
|
95 |
|
|
/**
|
96 |
|
|
* This method returns the list of fields that are serialized in this
|
97 |
|
|
* class. This will return either the list of fields with an
|
98 |
|
|
* "@serial" declaration, or, if it exists, the
|
99 |
|
|
* <code>serialPersistentField</code> field.
|
100 |
|
|
*
|
101 |
|
|
* @return The list of serializable fields.
|
102 |
|
|
*/
|
103 |
|
|
public abstract FieldDoc[]
|
104 |
|
|
serializableFields();
|
105 |
|
|
|
106 |
|
|
/*************************************************************************/
|
107 |
|
|
|
108 |
|
|
/**
|
109 |
|
|
* This method tests whether or not the class represented by this object
|
110 |
|
|
* specifically defines its serializable fields in a
|
111 |
|
|
* <code>serialPersistentFields</code> field.
|
112 |
|
|
*
|
113 |
|
|
* @return <code>true</code> if this class explicitly defines its
|
114 |
|
|
* serializable fields, <code>false</code> otherwise.
|
115 |
|
|
*/
|
116 |
|
|
public abstract boolean
|
117 |
|
|
definesSerializableFields();
|
118 |
|
|
|
119 |
|
|
/*************************************************************************/
|
120 |
|
|
|
121 |
|
|
/**
|
122 |
|
|
* This method returns the superclass of the class represented by this
|
123 |
|
|
* object.
|
124 |
|
|
*
|
125 |
|
|
* @return The superclass of this class.
|
126 |
|
|
*/
|
127 |
|
|
public abstract ClassDoc
|
128 |
|
|
superclass();
|
129 |
|
|
|
130 |
|
|
/*************************************************************************/
|
131 |
|
|
|
132 |
|
|
/**
|
133 |
|
|
* This method tests whether or not the class represented by this object is
|
134 |
|
|
* a subclass of the specified class.
|
135 |
|
|
*
|
136 |
|
|
* @param cls The <code>ClassDoc</code> object of the class to test against.
|
137 |
|
|
*
|
138 |
|
|
* @return <code>true</code> if this class is a subclass of the specified
|
139 |
|
|
* class, <code>false</code> otherwise.
|
140 |
|
|
*/
|
141 |
|
|
public abstract boolean
|
142 |
|
|
subclassOf(ClassDoc cls);
|
143 |
|
|
|
144 |
|
|
/*************************************************************************/
|
145 |
|
|
|
146 |
|
|
/**
|
147 |
|
|
* This method returns this list of interfaces implemented (or in the case
|
148 |
|
|
* of interfaces, extended) by this class. This list will only include
|
149 |
|
|
* interfaces directly implemented by this class, not those inherited by
|
150 |
|
|
* interfaced implemented in this class.
|
151 |
|
|
*
|
152 |
|
|
* @return The list of interfaces this class implements.
|
153 |
|
|
*/
|
154 |
|
|
public abstract ClassDoc[]
|
155 |
|
|
interfaces();
|
156 |
|
|
|
157 |
|
|
/*************************************************************************/
|
158 |
|
|
|
159 |
|
|
/**
|
160 |
|
|
* This method returns the list of fields that are visible to the user in
|
161 |
|
|
* this class, or the list of all fields in this class.
|
162 |
|
|
*
|
163 |
|
|
* @param filtered if true, only return visible (included) fields;
|
164 |
|
|
* otherwise, return all fields.
|
165 |
|
|
*
|
166 |
|
|
* @return The list of visible fields in this class, or the list of
|
167 |
|
|
* all fields in this class.
|
168 |
|
|
*/
|
169 |
|
|
public abstract FieldDoc[]
|
170 |
|
|
fields(boolean filtered);
|
171 |
|
|
|
172 |
|
|
/*************************************************************************/
|
173 |
|
|
|
174 |
|
|
/**
|
175 |
|
|
* This method returns the list of fields that are visible to the user in
|
176 |
|
|
* this class. Does this depend on the -private -protected, etc flags
|
177 |
|
|
* passed to javadoc?
|
178 |
|
|
*
|
179 |
|
|
* @return The list of visible fields in this class.
|
180 |
|
|
*/
|
181 |
|
|
public abstract FieldDoc[]
|
182 |
|
|
fields();
|
183 |
|
|
|
184 |
|
|
/*************************************************************************/
|
185 |
|
|
|
186 |
|
|
/**
|
187 |
|
|
* This method returns either the list of methods that are visible to
|
188 |
|
|
* the user in the class represented by this object, or a list of all
|
189 |
|
|
* methods, excluding constructor methods.
|
190 |
|
|
*
|
191 |
|
|
* @param filtered if true, only return visible (included) methods;
|
192 |
|
|
* otherwise, return all methods.
|
193 |
|
|
*
|
194 |
|
|
* @return The list of all methods in this class, or the list of
|
195 |
|
|
* visible methods in this class.
|
196 |
|
|
*/
|
197 |
|
|
public abstract MethodDoc[]
|
198 |
|
|
methods(boolean filtered);
|
199 |
|
|
|
200 |
|
|
/*************************************************************************/
|
201 |
|
|
|
202 |
|
|
/**
|
203 |
|
|
* This method returns the list of methods that are visible to the user in
|
204 |
|
|
* the class represented by this object, excluding constructor methods.
|
205 |
|
|
*
|
206 |
|
|
* @return The list of visible methods in this class.
|
207 |
|
|
*/
|
208 |
|
|
public abstract MethodDoc[]
|
209 |
|
|
methods();
|
210 |
|
|
|
211 |
|
|
/*************************************************************************/
|
212 |
|
|
|
213 |
|
|
/**
|
214 |
|
|
* This method returns either the list of constructors that are
|
215 |
|
|
* visible to the user in the class represented by this object, or
|
216 |
|
|
* the list of all constructors.
|
217 |
|
|
*
|
218 |
|
|
* @param filtered if true, only return visible (included)
|
219 |
|
|
* constructors; otherwise, return all constructors.
|
220 |
|
|
*
|
221 |
|
|
* @return The list of all constructors in this class, or the list
|
222 |
|
|
* of visible constructors in this class.
|
223 |
|
|
*/
|
224 |
|
|
public abstract ConstructorDoc[]
|
225 |
|
|
constructors(boolean filtered);
|
226 |
|
|
|
227 |
|
|
/*************************************************************************/
|
228 |
|
|
|
229 |
|
|
/**
|
230 |
|
|
* This method returns the list of constructors that are visible to the user
|
231 |
|
|
* in the class represented by this object.
|
232 |
|
|
*
|
233 |
|
|
* @return The list visible constructors in this class.
|
234 |
|
|
*/
|
235 |
|
|
public abstract ConstructorDoc[]
|
236 |
|
|
constructors();
|
237 |
|
|
|
238 |
|
|
/*************************************************************************/
|
239 |
|
|
|
240 |
|
|
/**
|
241 |
|
|
* This method returns the list of inner classes that are visible to
|
242 |
|
|
* the user within the class represented by this object.
|
243 |
|
|
*
|
244 |
|
|
* @return The list of visible inner classes for this object.
|
245 |
|
|
*/
|
246 |
|
|
public abstract ClassDoc[]
|
247 |
|
|
innerClasses();
|
248 |
|
|
|
249 |
|
|
/*************************************************************************/
|
250 |
|
|
|
251 |
|
|
/**
|
252 |
|
|
* This method returns the list of all inner classes within the class
|
253 |
|
|
* represented by this object, or the list of visible inner classes
|
254 |
|
|
* in this class.
|
255 |
|
|
*
|
256 |
|
|
* @param filtered if true, only return visible (included) inner
|
257 |
|
|
* classes; otherwise, return all inner classes.
|
258 |
|
|
*
|
259 |
|
|
* @return The list of all inner classes for this object, or the list
|
260 |
|
|
* of visible inner classes.
|
261 |
|
|
*/
|
262 |
|
|
public abstract ClassDoc[]
|
263 |
|
|
innerClasses(boolean filtered);
|
264 |
|
|
|
265 |
|
|
/*************************************************************************/
|
266 |
|
|
|
267 |
|
|
/**
|
268 |
|
|
* This method returns a <code>ClassDoc</code> for the named class. The
|
269 |
|
|
* following search order is used:
|
270 |
|
|
* <p>
|
271 |
|
|
* <ol>
|
272 |
|
|
* <li>Fully qualified class name.
|
273 |
|
|
* <li>Inner classes within this class.
|
274 |
|
|
* <li>In the current package.
|
275 |
|
|
* <li>In the imports for this class.
|
276 |
|
|
* </ol>
|
277 |
|
|
*
|
278 |
|
|
* @param name The name of the class to find.
|
279 |
|
|
*
|
280 |
|
|
* @return The requested class, or <code>null</code> if the requested
|
281 |
|
|
* class cannot be found.
|
282 |
|
|
*/
|
283 |
|
|
public abstract ClassDoc
|
284 |
|
|
findClass(String name);
|
285 |
|
|
|
286 |
|
|
/*************************************************************************/
|
287 |
|
|
|
288 |
|
|
/**
|
289 |
|
|
* This method returns the list of classes that are imported. This
|
290 |
|
|
* excludes any imports of complete packages.
|
291 |
|
|
*
|
292 |
|
|
* @return The list of imported classes.
|
293 |
|
|
*/
|
294 |
|
|
public abstract ClassDoc[]
|
295 |
|
|
importedClasses();
|
296 |
|
|
|
297 |
|
|
/*************************************************************************/
|
298 |
|
|
|
299 |
|
|
/**
|
300 |
|
|
* This method returns the list of packages that are imported. This
|
301 |
|
|
* excludes any individual class imports.
|
302 |
|
|
*
|
303 |
|
|
* @return The list of imported packages.
|
304 |
|
|
*/
|
305 |
|
|
public abstract PackageDoc[]
|
306 |
|
|
importedPackages();
|
307 |
|
|
|
308 |
|
|
/*************************************************************************/
|
309 |
|
|
|
310 |
|
|
/**
|
311 |
|
|
* This method returns the formal type parameters of this class.
|
312 |
|
|
* The returned array is empty if the class does not represent a
|
313 |
|
|
* parameterized type.
|
314 |
|
|
*
|
315 |
|
|
* @return The list of type parameters.
|
316 |
|
|
* @since 1.5
|
317 |
|
|
*/
|
318 |
|
|
TypeVariable[]
|
319 |
|
|
typeParameters();
|
320 |
|
|
|
321 |
|
|
} // interface ClassDoc
|