| java.lang.Object com.sun.tools.javadoc.DocImpl com.sun.tools.javadoc.ProgramElementDocImpl com.sun.tools.javadoc.ClassDocImpl
All known Subclasses: com.sun.tools.javadoc.AnnotationTypeDocImpl,
ClassDocImpl | public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc(Code) | | Represents a java class and provides access to information
about the class, the class' comment and tags, and the
members of the class. A ClassDocImpl 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 are
referred to using Type (which can be converted to ClassDocImpl,
if possible).
See Also: Type since: 1.2 author: Robert Field author: Neal Gafter (rewrite) author: Scott Seligman (generics, enums, annotations) |
Field Summary | |
boolean | isIncluded | final protected ClassSymbol | tsym | final public ClassType | type |
Method Summary | |
void | addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered) Adds all inner classes of this class, and their
inner classes recursively, to the list l. | public AnnotationTypeDoc | asAnnotationTypeDoc() Return null (unless overridden), as this is not an annotation type. | public ClassDoc | asClassDoc() Return this type as a class, which it already is. | public ParameterizedType | asParameterizedType() Return null, as this is not a class instantiation. | public TypeVariable | asTypeVariable() Return null, as this is not a type variable. | public WildcardType | asWildcardType() Return null, as this is not a wildcard type. | static String | classToString(DocEnv env, ClassSymbol c, boolean full) Return the class name with any type parameters as a string. | public ConstructorDoc[] | constructors(boolean filter) Return constructors in class. | public ConstructorDoc[] | constructors() Return included constructors in class. | public PackageDoc | containingPackage() Return the package that this class is contained in. | public boolean | definesSerializableFields() Return true if Serializable fields are explicitly defined with
the special class member serialPersistentFields . | public String | dimension() Return the type's dimension information. | public FieldDoc[] | enumConstants() Return the enum constants if this is an enum type. | public FieldDoc[] | fields(boolean filter) Return fields in class. | public FieldDoc[] | fields() Return included fields in class. | public ClassDoc | findClass(String className) Find a class within the context of this class. | public ConstructorDoc | findConstructor(String constrName, String[] paramTypes) Find constructor in this class.
Parameters: constrName - the unqualified name to search for. Parameters: paramTypeArray - the array of Strings for constructor parameters. | public FieldDoc | findField(String fieldName) Find a field in this class scope.
Search order: this class, outerclasses, interfaces,
superclasses. | public MethodDocImpl | findMethod(String methodName, String[] paramTypes) Find a method in this class scope.
Search order: this class, interfaces, superclasses, outerclasses.
Note that this is not necessarily what the compiler would do!
Parameters: methodName - the unqualified name to search for. Parameters: paramTypeArray - the array of Strings for method parameter types. | static String | getClassName(ClassSymbol c, boolean full) Return the class name as a string. | protected ClassSymbol | getContainingClass() | protected long | getFlags() | static long | getFlags(ClassSymbol clazz) | public ClassDoc[] | importedClasses() Get the list of classes declared as imported. | public PackageDoc[] | importedPackages() Get the list of packages declared as imported. | public ClassDoc[] | innerClasses(boolean filter) Return inner classes within this class.
Parameters: filter - include only the included inner classes if filter==true. | public ClassDoc[] | innerClasses() Return included inner classes within this class.
an array of ClassDocImpl for representing the visibleclasses defined in this class. | public com.sun.javadoc.Type[] | interfaceTypes() Return interfaces implemented by this class or interfaces extended
by this interface. | public ClassDoc[] | interfaces() Return interfaces implemented by this class or interfaces
extended by this interface. | public boolean | isAbstract() | static boolean | isAnnotationType(ClassSymbol clazz) | public boolean | isClass() Return true if this is a class, not an interface. | public boolean | isEnum() Return true if this is an enumeration. | public boolean | isError() | public boolean | isException() | public boolean | isExternalizable() Return true if this class implements
java.io.Externalizable . | static boolean | isGeneric(ClassSymbol c) | public boolean | isIncluded() Return true if this class is included in the active set. | public boolean | isInterface() Return true if this is an interface, but not an annotation type. | public boolean | isOrdinaryClass() Return true if this is a ordinary class,
not an enumeration, exception, an error, or an interface. | public boolean | isPrimitive() Return false, as this is not a primitive type. | boolean | isRuntimeException() Determine if a class is a RuntimeException. | public boolean | isSerializable() Return true if this class implements java.io.Serializable . | public boolean | isSynthetic() Returns true if this class was synthesized by the compiler. | public boolean | isThrowable() | public MethodDoc[] | methods(boolean filter) Return methods in class.
This method is overridden by AnnotationTypeDocImpl.
Parameters: filter - include only the included methods if filter==true an array of MethodDocImpl for representing the visiblemethods in this class. | public MethodDoc[] | methods() Return included methods in class.
an array of MethodDocImpl for representing the visiblemethods in this class. | public int | modifierSpecifier() | public String | modifiers() Return the modifier string for this class. | public String | name() Return the class name without package qualifier - but with
enclosing class qualifier - as a String. | public SourcePosition | position() Return the source position of the entity, or null if
no position is available. | public String | qualifiedName() Return the qualified class name as a String. | public String | qualifiedTypeName() Return qualified name of type excluding any dimension information. | public FieldDoc[] | serializableFields() Return the Serializable fields of class.
Return either a list of default fields documented by
serial tag
or return a single FieldDoc for
serialPersistentField member. | public MethodDoc[] | serializationMethods() Return the serialization methods for this class. | public String | simpleTypeName() Return the simple name of this type. | public boolean | subclassOf(ClassDoc cd) Test whether this class is a subclass of the specified class.
Parameters: cd - the candidate superclass. | public ClassDoc | superclass() | public com.sun.javadoc.Type | superclassType() Return the superclass of this class. | public String | toString() Return the qualified name and any type parameters. | public String | typeName() Return unqualified name of type excluding any dimension information. | public ParamTag[] | typeParamTags() Return the type parameter tags of this class or interface. | public TypeVariable[] | typeParameters() Return the formal type parameters of this class or interface. |
isIncluded | boolean isIncluded(Code) | | |
tsym | final protected ClassSymbol tsym(Code) | | |
type | final public ClassType type(Code) | | |
ClassDocImpl | public ClassDocImpl(DocEnv env, ClassSymbol sym)(Code) | | Constructor
|
addAllClasses | void addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered)(Code) | | Adds all inner classes of this class, and their
inner classes recursively, to the list l.
|
asAnnotationTypeDoc | public AnnotationTypeDoc asAnnotationTypeDoc()(Code) | | Return null (unless overridden), as this is not an annotation type.
|
asClassDoc | public ClassDoc asClassDoc()(Code) | | Return this type as a class, which it already is.
|
asParameterizedType | public ParameterizedType asParameterizedType()(Code) | | Return null, as this is not a class instantiation.
|
asTypeVariable | public TypeVariable asTypeVariable()(Code) | | Return null, as this is not a type variable.
|
asWildcardType | public WildcardType asWildcardType()(Code) | | Return null, as this is not a wildcard type.
|
classToString | static String classToString(DocEnv env, ClassSymbol c, boolean full)(Code) | | Return the class name with any type parameters as a string.
Each parameter is a type variable with optional bounds.
If "full" is true all names are qualified, otherwise they are
qualified by their enclosing class(es) only.
|
constructors | public ConstructorDoc[] constructors(boolean filter)(Code) | | Return constructors in class.
Parameters: filter - include only the included constructors if filter==true an array of ConstructorDocImpl for representing the visibleconstructors in this class. |
constructors | public ConstructorDoc[] constructors()(Code) | | Return included constructors in class.
an array of ConstructorDocImpl for representing the visibleconstructors in this class. |
containingPackage | public PackageDoc containingPackage()(Code) | | Return the package that this class is contained in.
|
dimension | public String dimension()(Code) | | Return the type's dimension information.
Always return "", as this is not an array type.
|
enumConstants | public FieldDoc[] enumConstants()(Code) | | Return the enum constants if this is an enum type.
|
fields | public FieldDoc[] fields(boolean filter)(Code) | | Return fields in class.
Parameters: filter - include only the included fields if filter==true |
fields | public FieldDoc[] fields()(Code) | | Return included fields in class.
|
findClass | public ClassDoc findClass(String className)(Code) | | Find a class within the context of this class.
Search order: qualified name, in this class (inner),
in this package, in the class imports, in the package
imports.
Return the ClassDocImpl if found, null if not found.
|
findConstructor | public ConstructorDoc findConstructor(String constrName, String[] paramTypes)(Code) | | Find constructor in this class.
Parameters: constrName - the unqualified name to search for. Parameters: paramTypeArray - the array of Strings for constructor parameters. the first ConstructorDocImpl which matches, null if not found. |
findField | public FieldDoc findField(String fieldName)(Code) | | Find a field in this class scope.
Search order: this class, outerclasses, interfaces,
superclasses. IMP: If see tag is defined in an inner class,
which extends a super class and if outerclass and the super
class have a visible field in common then Java compiler cribs
about the ambiguity, but the following code will search in the
above given search order.
Parameters: fieldName - the unqualified name to search for. the first FieldDocImpl which matches, null if not found. |
findMethod | public MethodDocImpl findMethod(String methodName, String[] paramTypes)(Code) | | Find a method in this class scope.
Search order: this class, interfaces, superclasses, outerclasses.
Note that this is not necessarily what the compiler would do!
Parameters: methodName - the unqualified name to search for. Parameters: paramTypeArray - the array of Strings for method parameter types. the first MethodDocImpl which matches, null if not found. |
getClassName | static String getClassName(ClassSymbol c, boolean full)(Code) | | Return the class name as a string. If "full" is true the name is
qualified, otherwise it is qualified by its enclosing class(es) only.
|
getContainingClass | protected ClassSymbol getContainingClass()(Code) | | Identify the containing class
|
getFlags | protected long getFlags()(Code) | | Returns the flags in terms of javac's flags
|
getFlags | static long getFlags(ClassSymbol clazz)(Code) | | Returns the flags of a ClassSymbol in terms of javac's flags
|
importedClasses | public ClassDoc[] importedClasses()(Code) | | Get the list of classes declared as imported.
These are called "single-type-import declarations" in the JLS.
This method is deprecated in the ClassDoc interface.
an array of ClassDocImpl representing the imported classes. |
importedPackages | public PackageDoc[] importedPackages()(Code) | | Get the list of packages declared as imported.
These are called "type-import-on-demand declarations" in the JLS.
This method is deprecated in the ClassDoc interface.
an array of PackageDocImpl representing the imported packages.###NOTE: the syntax supports importing all inner classes from a class as well. |
innerClasses | public ClassDoc[] innerClasses(boolean filter)(Code) | | Return inner classes within this class.
Parameters: filter - include only the included inner classes if filter==true. an array of ClassDocImpl for representing the visibleclasses defined in this class. Anonymous and local classesare not included. |
innerClasses | public ClassDoc[] innerClasses()(Code) | | Return included inner classes within this class.
an array of ClassDocImpl for representing the visibleclasses defined in this class. Anonymous and local classesare not included. |
interfaceTypes | public com.sun.javadoc.Type[] interfaceTypes()(Code) | | Return interfaces implemented by this class or interfaces extended
by this interface. Includes only directly-declared interfaces, not
inherited interfaces.
Return an empty array if there are no interfaces.
|
interfaces | public ClassDoc[] interfaces()(Code) | | Return interfaces implemented by this class or interfaces
extended by this interface.
An array of ClassDocImpl representing the interfaces.Return an empty array if there are no interfaces. |
isAbstract | public boolean isAbstract()(Code) | | Return true if this class is abstract
|
isAnnotationType | static boolean isAnnotationType(ClassSymbol clazz)(Code) | | Is a ClassSymbol an annotation type?
|
isClass | public boolean isClass()(Code) | | Return true if this is a class, not an interface.
|
isEnum | public boolean isEnum()(Code) | | Return true if this is an enumeration.
(For legacy doclets, return false.)
|
isError | public boolean isError()(Code) | | Return true if this is an error class
|
isException | public boolean isException()(Code) | | Return true if this is an exception class
|
isExternalizable | public boolean isExternalizable()(Code) | | Return true if this class implements
java.io.Externalizable .
|
isGeneric | static boolean isGeneric(ClassSymbol c)(Code) | | Is this class (or any enclosing class) generic? That is, does
it have type parameters?
|
isIncluded | public boolean isIncluded()(Code) | | Return true if this class is included in the active set.
A ClassDoc is included iff either it is specified on the
commandline, or if it's containing package is specified
on the command line, or if it is a member class of an
included class.
|
isInterface | public boolean isInterface()(Code) | | Return true if this is an interface, but not an annotation type.
Overridden by AnnotationTypeDocImpl.
|
isOrdinaryClass | public boolean isOrdinaryClass()(Code) | | Return true if this is a ordinary class,
not an enumeration, exception, an error, or an interface.
|
isPrimitive | public boolean isPrimitive()(Code) | | Return false, as this is not a primitive type.
|
isRuntimeException | boolean isRuntimeException()(Code) | | Determine if a class is a RuntimeException.
Used only by ThrowsTagImpl.
|
isSerializable | public boolean isSerializable()(Code) | | Return true if this class implements java.io.Serializable .
Since java.io.Externalizable extends
java.io.Serializable ,
Externalizable objects are also Serializable.
|
isSynthetic | public boolean isSynthetic()(Code) | | Returns true if this class was synthesized by the compiler.
|
isThrowable | public boolean isThrowable()(Code) | | Return true if this is a throwable class
|
methods | public MethodDoc[] methods(boolean filter)(Code) | | Return methods in class.
This method is overridden by AnnotationTypeDocImpl.
Parameters: filter - include only the included methods if filter==true an array of MethodDocImpl for representing the visiblemethods in this class. Does not include constructors. |
methods | public MethodDoc[] methods()(Code) | | Return included methods in class.
an array of MethodDocImpl for representing the visiblemethods in this class. Does not include constructors. |
modifierSpecifier | public int modifierSpecifier()(Code) | | |
modifiers | public String modifiers()(Code) | | Return the modifier string for this class. If it's an interface
exclude 'abstract' keyword from the modifier string
|
name | public String name()(Code) | | Return the class name without package qualifier - but with
enclosing class qualifier - as a String.
Examples:
for java.util.Hashtable
return Hashtable
for java.util.Map.Entry
return Map.Entry
|
position | public SourcePosition position()(Code) | | Return the source position of the entity, or null if
no position is available.
|
qualifiedName | public String qualifiedName()(Code) | | Return the qualified class name as a String.
Example:
for java.util.Hashtable
return java.util.Hashtable
if no qualifier, just return flat name
|
qualifiedTypeName | public String qualifiedTypeName()(Code) | | Return qualified name of type excluding any dimension information.
For example, a two dimensional array of String
returns 'java.lang.String'.
|
serializableFields | public FieldDoc[] serializableFields()(Code) | | Return the Serializable fields of class.
Return either a list of default fields documented by
serial tag
or return a single FieldDoc for
serialPersistentField member.
There should be a serialField tag for
each Serializable field defined by an ObjectStreamField
array component of serialPersistentField .
See Also: ClassDocImpl.definesSerializableFields() See Also: SerialFieldTagImpl |
serializationMethods | public MethodDoc[] serializationMethods()(Code) | | Return the serialization methods for this class.
an array of MethodDocImpl that representsthe serialization methods for this class. |
simpleTypeName | public String simpleTypeName()(Code) | | Return the simple name of this type.
|
subclassOf | public boolean subclassOf(ClassDoc cd)(Code) | | Test whether this class is a subclass of the specified class.
Parameters: cd - the candidate superclass. true if cd is a superclass of this class. |
superclass | public ClassDoc superclass()(Code) | | Return the superclass of this class
the ClassDocImpl for the superclass of this class, nullif there is no superclass. |
superclassType | public com.sun.javadoc.Type superclassType()(Code) | | Return the superclass of this class. Return null if this is an
interface. A superclass is represented by either a
ClassDoc or a ParameterizedType .
|
toString | public String toString()(Code) | | Return the qualified name and any type parameters.
Each parameter is a type variable with optional bounds.
|
typeName | public String typeName()(Code) | | Return unqualified name of type excluding any dimension information.
For example, a two dimensional array of String returns 'String'.
|
typeParamTags | public ParamTag[] typeParamTags()(Code) | | Return the type parameter tags of this class or interface.
|
typeParameters | public TypeVariable[] typeParameters()(Code) | | Return the formal type parameters of this class or interface.
Return an empty array if there are none.
|
|
|