net.cscott.sinjdoc

Interface ClassDoc

public interface ClassDoc extends ProgramElementDoc

The ClassDoc interface represents a java class and raw type and provides access to information about the class, the class' comment and tags, and the members of the class. A ClassDoc only exists if it was processed in this run of javadoc. References to classes which may or may not have been processed in this run and parameterized types are referred to using Type (components of which can be converted to ClassDoc, if possible).

Version: $Id: ClassDoc.java,v 1.5 2003/05/08 03:54:25 cananian Exp $

Author: C. Scott Ananian (cscott@cscott.net)

See Also: com.sun.javadoc.ClassDoc

Method Summary
List<ConstructorDoc>constructors()
Return visible constructors in class.
booleandefinesSerializableFields()
Return true iif serializable fields are explicitly defined with the special class member serialPersistentFields.
List<FieldDoc>fields()
Return visible fields in class.
ClassDocfindClass(String className)
Find a class within the context of this class.
List<ClassType>importedClasses()
Get the list of classes declared as imported.
List<PackageDoc>importedPackages()
Get the list of packages declared as imported.
List<ClassDoc>innerClasses()
Return visible inner classes within this class, not including anonymous and local classes.
List<Type>interfaces()
Return interfaces implemented by this class of interfaces extended by this interface.
booleanisAbstract()
Return true if this class is abstract.
booleanisExternalizable()
Return true if this class implements java.io.Externalizable.
booleanisSerializable()
Return true if this class implements java.io.Serializable.
List<MethodDoc>methods()
Return visible methods in class, not including constructors.
List<FieldDoc>serializableFields()
Return the serializable fields of this class.
List<MethodDoc>serializationMethods()
Return the serialization methods for this class.
booleansubclassOf(ClassDoc cd)
Test whether this class is a subclass of the specified class.
Typesuperclass()
Return the superclass of this class, or null if there is no superclass.
ClassTypetype()
Return the ClassType corresponding to this ClassDoc.
List<ClassTypeVariable>typeParameters()
Return the type variables declared by this class, if it is generic; otherwise return a zero-length list.

Method Detail

constructors

public List<ConstructorDoc> constructors()
Return visible constructors in class. An array containing the default no-arg constructor is returned if no other constructors exist.

definesSerializableFields

public boolean definesSerializableFields()
Return true iif serializable fields are explicitly defined with the special class member serialPersistentFields.

See Also: SerialFieldTag

fields

public List<FieldDoc> fields()
Return visible fields in class.

findClass

public ClassDoc findClass(String className)
Find a class within the context of this class. Search order is qualified name, in this class (inner), in this package, in the class imports, in the package imports. Return the ClassDoc if found, null if not found.

importedClasses

public List<ClassType> importedClasses()
Get the list of classes declared as imported. These are called "simple-type-import declarations" in the JLS.

importedPackages

public List<PackageDoc> importedPackages()
Get the list of packages declared as imported. These are called "type-import-on-demand declarations" in the JLS.

innerClasses

public List<ClassDoc> innerClasses()
Return visible inner classes within this class, not including anonymous and local classes.

interfaces

public List<Type> interfaces()
Return interfaces implemented by this class of interfaces extended by this interface. Includes only directly declared interfaces, not inherited interfaces. Returns a zero-length array if there are no interfaces.

isAbstract

public boolean isAbstract()
Return true if this class is abstract.

isExternalizable

public boolean isExternalizable()
Return true if this class implements java.io.Externalizable. Since java.io.Externalizable extends java.io.Serializable, Externalizable objects are also Serializable.

isSerializable

public boolean isSerializable()
Return true if this class implements java.io.Serializable. Since java.io.Externalizable extends java.io.Serializable, Externalizable objects are also Serializable.

methods

public List<MethodDoc> methods()
Return visible methods in class, not including constructors.

serializableFields

public List<FieldDoc> serializableFields()
Return the serializable fields of this class.

Return either a list of default fields documented by the serial tag or a single FieldDoc for the serialPersistentField member. There should be a serialField tag for each serializable field defined by an ObjectStreamField array component of serialPersistentField.

Returns: an array of FieldDoc for the serializable fields of this class.

See Also: SerialFieldTag

serializationMethods

public List<MethodDoc> serializationMethods()
Return the serialization methods for this class.

Returns: an array of MethodDoc that represents the serialization methods for this class.

subclassOf

public boolean subclassOf(ClassDoc cd)
Test whether this class is a subclass of the specified class.

Parameters: cd the candidate superclass.

Returns: true if cd is a superclass of this class.

superclass

public Type superclass()
Return the superclass of this class, or null if there is no superclass.

type

public ClassType type()
Return the ClassType corresponding to this ClassDoc.

typeParameters

public List<ClassTypeVariable> typeParameters()
Return the type variables declared by this class, if it is generic; otherwise return a zero-length list.

See Also: ClassType

Copyright © 2003 C. Scott Ananian