Contents | Package | Class | Tree | Index
PREV | NEXT SHOW LISTS | HIDE LISTS

Class sun.tools.javadoc.ClassDoc

java.lang.Object
    |
    +----sun.tools.javadoc.Doc
            |
            +----sun.tools.javadoc.ProgramElementDoc
                    |
                    +----sun.tools.javadoc.ClassDoc

public class ClassDoc
extends ProgramElementDoc
implements Type
Represents a java class. 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 are refered to via Type (which can be converted to ClassDoc if possible).

Since:
JDK1.2
See Also:
Type

Method Summary
ClassDoc  asClassDoc()
Return this type as a class.
ConstructorDoc[]  constructors()
Return constructors in class.
PackageDoc  containingPackage()
Return the package that this class is contained in.
java.lang.String  dimension()
Return the type's dimension information, as a string.
FieldDoc[]  fields()
Return fields in class.
ClassDoc  findClass(java.lang.String className)
Find a class within the context of this class.
FieldDoc  findField(java.lang.String fieldName)
Find a field in this class.
MethodDoc  findMethod(java.lang.String methodName)
Find a method in this class.
ClassDoc[]  implementedInterfaces()
Return interfaces which this class implements.
ClassDoc[]  importedClasses()
Get the list of classes declared as imported.
PackageDoc[]  importedPackages()
Get the list of packages declared as imported.
ClassDoc[]  innerClasses()
Return inner classes within this class.
boolean  isAbstract()
Return true if this class is abstract
boolean  isClass()
return true if this is a class (that is, not interface).
boolean  isError()
Return true if this is an error class
boolean  isException()
Return true if this is an exception class
boolean  isIncluded()
return true if this class is include in the active set.
boolean  isInterface()
Return true if this is an interface.
boolean  isOrdinaryClass()
return true if this is a ordinary class (that is, not an exception, error or interface).
MethodDoc[]  methods()
Return methods in class.
java.lang.String  name()
Return, as a string, the class name without qualifier.
java.lang.String  qualifiedName()
Return, as a string, the qualified class name.
boolean  subclassOf(ClassDoc cd)
Test whether this class is a subclass of the specified class.
ClassDoc  superclass()
Return the superclass of this class
java.lang.String  toString()
Returns a string representation of the class.
 
Methods inherited from class sun.tools.javadoc.ProgramElementDoc
 containingClass, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier
 
Methods inherited from class sun.tools.javadoc.Doc
 commentText, compareTo, getRawCommentText, isClass, isConstructor, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, name, seeTags, setRawCommentText, tags, tags, toString
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isClass

public boolean isClass()
return true if this is a class (that is, not interface).
Overrides:
isClass in class Doc

isOrdinaryClass

public boolean isOrdinaryClass()
return true if this is a ordinary class (that is, not an exception, error or interface).
Overrides:
isOrdinaryClass in class Doc

isInterface

public boolean isInterface()
Return true if this is an interface.
Overrides:
isInterface in class Doc

isException

public boolean isException()
Return true if this is an exception class
Overrides:
isException in class Doc

isError

public boolean isError()
Return true if this is an error class
Overrides:
isError in class Doc

isAbstract

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

isIncluded

public boolean isIncluded()
return true if this class is include in the active set.
Overrides:
isIncluded in class Doc

containingPackage

public PackageDoc containingPackage()
Return the package that this class is contained in.

name

public java.lang.String name()
Return, as a string, the class name without qualifier.
 Example:
  for java.util.Hashtable
  return Hashtable
 
Implements:
name in interface Type
Overrides:
name in class Doc

qualifiedName

public java.lang.String qualifiedName()
Return, as a string, the qualified class name.
 Example:
  for java.util.Hashtable
  return java.util.Hashtable
  if no qualifier, just return flat name
 
Implements:
qualifiedName in interface Type

superclass

public ClassDoc superclass()
Return the superclass of this class
Returns:
the ClassDoc for the superclass of this class, null if there is no superclass.

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.

implementedInterfaces

public ClassDoc[] implementedInterfaces()
Return interfaces which this class implements.
Returns:
an array of ClassDoc representing the interfaces that this class implements, return an empty array if the class implements no interfaces.

fields

public FieldDoc[] fields()
Return fields in class.
Returns:
an array of FieldDoc for representing the visible fields in this class.

methods

public MethodDoc[] methods()
Return methods in class.
Returns:
an array of MethodDoc for representing the visible methods in this class. Does not include constructors.

constructors

public ConstructorDoc[] constructors()
Return constructors in class.
Returns:
an array of ConstructorDoc for representing the visible constructors in this class.

innerClasses

public ClassDoc[] innerClasses()
Return inner classes within this class.
Returns:
an array of ClassDoc for representing the visible classes defined in this class. Anonymous and local classes are not included.

findClass

public ClassDoc findClass(java.lang.String className)
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 ClassDoc if found, null if not found.

findMethod

public MethodDoc findMethod(java.lang.String methodName)
Find a method in this class. Search order: this class, superclasses.
Parameters:
methodName - the unqualified name to search for.
Returns:
the first MethodDoc which matches, null if not found.

findField

public FieldDoc findField(java.lang.String fieldName)
Find a field in this class. Search order: this class, superclasses.
Parameters:
fieldName - the unqualified name to search for.
Returns:
the first FieldDoc which matches, null if not found.

importedClasses

public ClassDoc[] importedClasses()
Get the list of classes declared as imported. These are called "single-type-import declarations" in the JLS.
Returns:
an array of ClassDoc representing the imported classes.

importedPackages

public PackageDoc[] importedPackages()
Get the list of packages declared as imported. These are called "type-import-on-demand declarations" in the JLS.
Returns:
an array of PackageDoc representing the imported packages.

dimension

public java.lang.String dimension()
Return the type's dimension information, as a string.

For example, a two dimensional array of String returns '[][]'.

In ClassDoc so that it implements Type interface, always returns empty string.

Implements:
dimension in interface Type

asClassDoc

public ClassDoc asClassDoc()
Return this type as a class. Array dimensions are ignored.

In ClassDoc so that it implements Type interface, always returns this.

Implements:
asClassDoc in interface Type
Returns:
a ClassDoc if the type is a Class. Return null if it is a primitive type..

toString

public java.lang.String toString()
Returns a string representation of the class.
Implements:
toString in interface Type
Returns:
the qualified class name
Overrides:
toString in class Doc

Contents | Package | Class | Tree | Index
PREV | NEXT SHOW LISTS | HIDE LISTS