Class ClassDocImpl
- java.lang.Object
-
- gw.gosudoc.com.sun.tools.javadoc.main.DocImpl
-
- gw.gosudoc.com.sun.tools.javadoc.main.ProgramElementDocImpl
-
- gw.gosudoc.com.sun.tools.javadoc.main.ClassDocImpl
-
- All Implemented Interfaces:
ClassDoc
,Doc
,ProgramElementDoc
,Type
,Comparable<Object>
- Direct Known Subclasses:
AnnotationTypeDocImpl
@Deprecated public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc
Deprecated.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).This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
- Since:
- 1.2
- Author:
- Robert Field, Neal Gafter (rewrite), Scott Seligman (generics, enums, annotations)
- See Also:
Type
-
-
Constructor Summary
Constructors Constructor Description ClassDocImpl(DocEnv env, com.sun.tools.javac.code.Symbol.ClassSymbol sym)
Deprecated.ConstructorClassDocImpl(DocEnv env, com.sun.tools.javac.code.Symbol.ClassSymbol sym, com.sun.source.util.TreePath treePath)
Deprecated.Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AnnotatedType
asAnnotatedType()
Deprecated.Returns null, as this is not an annotated type.AnnotationTypeDoc
asAnnotationTypeDoc()
Deprecated.Return null (unless overridden), as this is not an annotation type.ClassDoc
asClassDoc()
Deprecated.Return this type as a class, which it already is.ParameterizedType
asParameterizedType()
Deprecated.Return null, as this is not a class instantiation.TypeVariable
asTypeVariable()
Deprecated.Return null, as this is not a type variable.WildcardType
asWildcardType()
Deprecated.Return null, as this is not a wildcard type.ConstructorDoc[]
constructors()
Deprecated.Return included constructors in class.ConstructorDoc[]
constructors(boolean filter)
Deprecated.Return constructors in class.PackageDoc
containingPackage()
Deprecated.Return the package that this class is contained in.boolean
definesSerializableFields()
Deprecated.Return true if Serializable fields are explicitly defined with the special class memberserialPersistentFields
.String
dimension()
Deprecated.Return the type's dimension information.FieldDoc[]
enumConstants()
Deprecated.Return the enum constants if this is an enum type.FieldDoc[]
fields()
Deprecated.Return included fields in class.FieldDoc[]
fields(boolean filter)
Deprecated.Return fields in class.ClassDoc
findClass(String className)
Deprecated.Find a class within the context of this class.ConstructorDoc
findConstructor(String constrName, String[] paramTypes)
Deprecated.Find constructor in this class.FieldDoc
findField(String fieldName)
Deprecated.Find a field in this class scope.MethodDocImpl
findMethod(String methodName, String[] paramTypes)
Deprecated.Find a method in this class scope.protected com.sun.tools.javac.code.Symbol.ClassSymbol
getContainingClass()
Deprecated.Identify the containing classType
getElementType()
Deprecated.If this type is an array type, return the element type of the array.protected long
getFlags()
Deprecated.Returns the flags in terms of javac's flagsClassDoc[]
importedClasses()
Deprecated.Import declarations are implementation details that should not be exposed here.PackageDoc[]
importedPackages()
Deprecated.Import declarations are implementation details that should not be exposed here.ClassDoc[]
innerClasses()
Deprecated.Return included inner classes within this class.ClassDoc[]
innerClasses(boolean filter)
Deprecated.Return inner classes within this class.ClassDoc[]
interfaces()
Deprecated.Return interfaces implemented by this class or interfaces extended by this interface.Type[]
interfaceTypes()
Deprecated.Return interfaces implemented by this class or interfaces extended by this interface.boolean
isAbstract()
Deprecated.Return true if this class is abstractboolean
isClass()
Deprecated.Return true if this is a class, not an interface.boolean
isEnum()
Deprecated.Return true if this is an enumeration.boolean
isError()
Deprecated.Return true if this is an error classboolean
isException()
Deprecated.Return true if this is an exception classboolean
isExternalizable()
Deprecated.Return true if this class implementsjava.io.Externalizable
.boolean
isIncluded()
Deprecated.Return true if this class is included in the active set.boolean
isInterface()
Deprecated.Return true if this is an interface, but not an annotation type.boolean
isOrdinaryClass()
Deprecated.Return true if this is a ordinary class, not an enumeration, exception, an error, or an interface.boolean
isPrimitive()
Deprecated.Return false, as this is not a primitive type.boolean
isSerializable()
Deprecated.Return true if this class implementsjava.io.Serializable
.boolean
isSynthetic()
Deprecated.Returns true if this class was synthesized by the compiler.boolean
isThrowable()
Deprecated.Return true if this is a throwable classMethodDoc[]
methods()
Deprecated.Return included methods in class.MethodDoc[]
methods(boolean filter)
Deprecated.Return methods in class.String
modifiers()
Deprecated.Return the modifier string for this class.int
modifierSpecifier()
Deprecated.Get the modifier specifier integer.String
name()
Deprecated.Return the class name without package qualifier - but with enclosing class qualifier - as a String.SourcePosition
position()
Deprecated.Return the source position of the entity, or null if no position is available.String
qualifiedName()
Deprecated.Return the qualified class name as a String.String
qualifiedTypeName()
Deprecated.Return qualified name of type excluding any dimension information.FieldDoc[]
serializableFields()
Deprecated.Return the Serializable fields of class.MethodDoc[]
serializationMethods()
Deprecated.Return the serialization methods for this class.String
simpleTypeName()
Deprecated.Return the simple name of this type.boolean
subclassOf(ClassDoc cd)
Deprecated.Test whether this class is a subclass of the specified class.ClassDoc
superclass()
Deprecated.Return the superclass of this classType
superclassType()
Deprecated.Return the superclass of this class.String
toString()
Deprecated.Return the qualified name and any type parameters.String
typeName()
Deprecated.Return unqualified name of type excluding any dimension information.TypeVariable[]
typeParameters()
Deprecated.Return the formal type parameters of this class or interface.ParamTag[]
typeParamTags()
Deprecated.Return the type parameter tags of this class or interface.-
Methods inherited from class gw.gosudoc.com.sun.tools.javadoc.main.ProgramElementDocImpl
annotations, containingClass, getModifiers, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
Methods inherited from class gw.gosudoc.com.sun.tools.javadoc.main.DocImpl
commentText, compareTo, documentation, firstSentenceTags, getRawCommentText, inlineTags, isAnnotationType, isAnnotationTypeElement, isConstructor, isEnumConstant, isField, isMethod, seeTags, setRawCommentText, tags, tags
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.gosudoc.com.sun.javadoc.Doc
commentText, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isAnnotationType, isAnnotationTypeElement, isConstructor, isEnumConstant, isField, isMethod, seeTags, setRawCommentText, tags, tags
-
Methods inherited from interface gw.gosudoc.com.sun.javadoc.ProgramElementDoc
annotations, containingClass, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
-
-
-
Method Detail
-
getElementType
public Type getElementType()
Deprecated.Description copied from interface:Type
If this type is an array type, return the element type of the array. Otherwise, return null.- Specified by:
getElementType
in interfaceType
- Returns:
- a
Type
representing the element type or null.
-
getFlags
protected long getFlags()
Deprecated.Returns the flags in terms of javac's flags- Specified by:
getFlags
in classProgramElementDocImpl
-
getContainingClass
protected com.sun.tools.javac.code.Symbol.ClassSymbol getContainingClass()
Deprecated.Identify the containing class- Specified by:
getContainingClass
in classProgramElementDocImpl
-
isClass
public boolean isClass()
Deprecated.Return true if this is a class, not an interface.
-
isOrdinaryClass
public boolean isOrdinaryClass()
Deprecated.Return true if this is a ordinary class, not an enumeration, exception, an error, or an interface.- Specified by:
isOrdinaryClass
in interfaceDoc
- Overrides:
isOrdinaryClass
in classDocImpl
- Returns:
- true if it represents an ordinary class
-
isEnum
public boolean isEnum()
Deprecated.Return true if this is an enumeration. (For legacy doclets, return false.)
-
isInterface
public boolean isInterface()
Deprecated.Return true if this is an interface, but not an annotation type. Overridden by AnnotationTypeDocImpl.- Specified by:
isInterface
in interfaceDoc
- Overrides:
isInterface
in classDocImpl
- Returns:
- true if it represents a interface
-
isException
public boolean isException()
Deprecated.Return true if this is an exception class- Specified by:
isException
in interfaceDoc
- Overrides:
isException
in classDocImpl
- Returns:
- true if it represents a exception
-
isError
public boolean isError()
Deprecated.Return true if this is an error class
-
isThrowable
public boolean isThrowable()
Deprecated.Return true if this is a throwable class
-
isAbstract
public boolean isAbstract()
Deprecated.Return true if this class is abstract- Specified by:
isAbstract
in interfaceClassDoc
- Returns:
- true if this class is abstract. Return true for all interfaces.
-
isSynthetic
public boolean isSynthetic()
Deprecated.Returns true if this class was synthesized by the compiler.
-
isIncluded
public boolean isIncluded()
Deprecated.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.- Specified by:
isIncluded
in interfaceDoc
- Specified by:
isIncluded
in classDocImpl
- Returns:
- true if this Doc item is included in the result set.
-
containingPackage
public PackageDoc containingPackage()
Deprecated.Return the package that this class is contained in.- Specified by:
containingPackage
in interfaceProgramElementDoc
- Overrides:
containingPackage
in classProgramElementDocImpl
- Returns:
- a PackageDoc for this element containing package. If in the unnamed package, this PackageDoc will have the name "".
-
name
public String name()
Deprecated.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
-
qualifiedName
public String qualifiedName()
Deprecated.Return the qualified class name as a String.Example: for java.util.Hashtable return java.util.Hashtable if no qualifier, just return flat name
- Specified by:
qualifiedName
in interfaceProgramElementDoc
- Specified by:
qualifiedName
in classDocImpl
- Returns:
- the name
-
typeName
public String typeName()
Deprecated.Return unqualified name of type excluding any dimension information.For example, a two dimensional array of String returns 'String'.
-
qualifiedTypeName
public String qualifiedTypeName()
Deprecated.Return qualified name of type excluding any dimension information.For example, a two dimensional array of String returns 'java.lang.String'.
- Specified by:
qualifiedTypeName
in interfaceType
- Returns:
- qualified name of this type excluding any dimension information.
-
simpleTypeName
public String simpleTypeName()
Deprecated.Return the simple name of this type.- Specified by:
simpleTypeName
in interfaceType
- Returns:
- the simple name of this type excluding any dimension information.
-
toString
public String toString()
Deprecated.Return the qualified name and any type parameters. Each parameter is a type variable with optional bounds.
-
typeParameters
public TypeVariable[] typeParameters()
Deprecated.Return the formal type parameters of this class or interface. Return an empty array if there are none.- Specified by:
typeParameters
in interfaceClassDoc
- Returns:
- the formal type parameters of this class or interface.
-
typeParamTags
public ParamTag[] typeParamTags()
Deprecated.Return the type parameter tags of this class or interface.- Specified by:
typeParamTags
in interfaceClassDoc
- Returns:
- the type parameter tags of this class or interface.
-
modifiers
public String modifiers()
Deprecated.Return the modifier string for this class. If it's an interface exclude 'abstract' keyword from the modifier string- Specified by:
modifiers
in interfaceProgramElementDoc
- Overrides:
modifiers
in classProgramElementDocImpl
- Returns:
- "public abstract".
-
modifierSpecifier
public int modifierSpecifier()
Deprecated.Description copied from class:ProgramElementDocImpl
Get the modifier specifier integer.- Specified by:
modifierSpecifier
in interfaceProgramElementDoc
- Overrides:
modifierSpecifier
in classProgramElementDocImpl
- Returns:
- Get the modifier specifier integer.
- See Also:
Modifier
-
superclass
public ClassDoc superclass()
Deprecated.Return the superclass of this class- Specified by:
superclass
in interfaceClassDoc
- Returns:
- the ClassDocImpl for the superclass of this class, null if there is no superclass.
- See Also:
ClassDoc.superclassType()
-
superclassType
public Type superclassType()
Deprecated.Return the superclass of this class. Return null if this is an interface. A superclass is represented by either aClassDoc
or aParameterizedType
.- Specified by:
superclassType
in interfaceClassDoc
- Returns:
- the superclass of this class, or null if there is no superclass.
-
subclassOf
public boolean subclassOf(ClassDoc cd)
Deprecated.Test whether this class is a subclass of the specified class.- Specified by:
subclassOf
in interfaceClassDoc
- Parameters:
cd
- the candidate superclass.- Returns:
- true if cd is a superclass of this class.
-
interfaces
public ClassDoc[] interfaces()
Deprecated.Return interfaces implemented by this class or interfaces extended by this interface.- Specified by:
interfaces
in interfaceClassDoc
- Returns:
- An array of ClassDocImpl representing the interfaces. Return an empty array if there are no interfaces.
- See Also:
ClassDoc.interfaceTypes()
-
interfaceTypes
public Type[] interfaceTypes()
Deprecated.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.- Specified by:
interfaceTypes
in interfaceClassDoc
- Returns:
- an array of interfaces, each represented by a
ClassDoc
or aParametrizedType
.
-
fields
public FieldDoc[] fields(boolean filter)
Deprecated.Return fields in class.
-
fields
public FieldDoc[] fields()
Deprecated.Return included fields in class.
-
enumConstants
public FieldDoc[] enumConstants()
Deprecated.Return the enum constants if this is an enum type.- Specified by:
enumConstants
in interfaceClassDoc
- Returns:
- the enum constants if this is an enum type.
-
methods
public MethodDoc[] methods(boolean filter)
Deprecated.Return methods in class. This method is overridden by AnnotationTypeDocImpl.
-
methods
public MethodDoc[] methods()
Deprecated.Return included methods in class.
-
constructors
public ConstructorDoc[] constructors(boolean filter)
Deprecated.Return constructors in class.- Specified by:
constructors
in interfaceClassDoc
- Parameters:
filter
- include only the included constructors if filter==true- Returns:
- an array of ConstructorDocImpl for representing the visible constructors in this class.
-
constructors
public ConstructorDoc[] constructors()
Deprecated.Return included constructors in class.- Specified by:
constructors
in interfaceClassDoc
- Returns:
- an array of ConstructorDocImpl for representing the visible constructors in this class.
-
innerClasses
public ClassDoc[] innerClasses(boolean filter)
Deprecated.Return inner classes within this class.- Specified by:
innerClasses
in interfaceClassDoc
- Parameters:
filter
- include only the included inner classes if filter==true.- Returns:
- an array of ClassDocImpl for representing the visible classes defined in this class. Anonymous and local classes are not included.
-
innerClasses
public ClassDoc[] innerClasses()
Deprecated.Return included inner classes within this class.- Specified by:
innerClasses
in interfaceClassDoc
- Returns:
- an array of ClassDocImpl for representing the visible classes defined in this class. Anonymous and local classes are not included.
-
findClass
public ClassDoc findClass(String className)
Deprecated.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.
-
findMethod
public MethodDocImpl findMethod(String methodName, String[] paramTypes)
Deprecated.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.paramTypes
- the array of Strings for method parameter types.- Returns:
- the first MethodDocImpl which matches, null if not found.
-
findConstructor
public ConstructorDoc findConstructor(String constrName, String[] paramTypes)
Deprecated.Find constructor in this class.- Parameters:
constrName
- the unqualified name to search for.paramTypes
- the array of Strings for constructor parameters.- Returns:
- the first ConstructorDocImpl which matches, null if not found.
-
findField
public FieldDoc findField(String fieldName)
Deprecated.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.- Returns:
- the first FieldDocImpl which matches, null if not found.
-
importedClasses
@Deprecated public ClassDoc[] importedClasses()
Deprecated.Import declarations are implementation details that should not be exposed here. In addition, not all imported classes are imported through single-type-import declarations.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.- Specified by:
importedClasses
in interfaceClassDoc
- Returns:
- an array of ClassDocImpl representing the imported classes.
-
importedPackages
@Deprecated public PackageDoc[] importedPackages()
Deprecated.Import declarations are implementation details that should not be exposed here. In addition, this method's return type does not allow for all type-import-on-demand declarations to be returned.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.- Specified by:
importedPackages
in interfaceClassDoc
- Returns:
- an array of PackageDocImpl representing the imported packages. ###NOTE: the syntax supports importing all inner classes from a class as well.
-
dimension
public String dimension()
Deprecated.Return the type's dimension information. Always return "", as this is not an array type.
-
asClassDoc
public ClassDoc asClassDoc()
Deprecated.Return this type as a class, which it already is.- Specified by:
asClassDoc
in interfaceType
- Returns:
- the
ClassDoc
of this type, or null if it is a primitive type.
-
asAnnotationTypeDoc
public AnnotationTypeDoc asAnnotationTypeDoc()
Deprecated.Return null (unless overridden), as this is not an annotation type.- Specified by:
asAnnotationTypeDoc
in interfaceType
- Returns:
- an
AnnotationTypeDoc
if the type is an annotation type, or null if it is not.
-
asParameterizedType
public ParameterizedType asParameterizedType()
Deprecated.Return null, as this is not a class instantiation.- Specified by:
asParameterizedType
in interfaceType
- Returns:
- a
ParameterizedType
if the type is an invocation of a generic type, or null if it is not.
-
asTypeVariable
public TypeVariable asTypeVariable()
Deprecated.Return null, as this is not a type variable.- Specified by:
asTypeVariable
in interfaceType
- Returns:
- a
TypeVariable
if the type is a type variable, or null if it is not.
-
asWildcardType
public WildcardType asWildcardType()
Deprecated.Return null, as this is not a wildcard type.- Specified by:
asWildcardType
in interfaceType
- Returns:
- a
WildcardType
if the type is a wildcard type, or null if it is not.
-
asAnnotatedType
public AnnotatedType asAnnotatedType()
Deprecated.Returns null, as this is not an annotated type.- Specified by:
asAnnotatedType
in interfaceType
- Returns:
- a
AnnotatedType
if the type if an annotated type, or null if it is not
-
isPrimitive
public boolean isPrimitive()
Deprecated.Return false, as this is not a primitive type.- Specified by:
isPrimitive
in interfaceType
- Returns:
- true if this type represents a primitive type.
-
isSerializable
public boolean isSerializable()
Deprecated.Return true if this class implementsjava.io.Serializable
. Sincejava.io.Externalizable
extendsjava.io.Serializable
, Externalizable objects are also Serializable.- Specified by:
isSerializable
in interfaceClassDoc
- Returns:
- true if this class implements or interface extends
java.io.Serializable
.
-
isExternalizable
public boolean isExternalizable()
Deprecated.Return true if this class implementsjava.io.Externalizable
.- Specified by:
isExternalizable
in interfaceClassDoc
- Returns:
- true if this class implements or interface extends
java.io.Externalizable
.
-
serializationMethods
public MethodDoc[] serializationMethods()
Deprecated.Return the serialization methods for this class.- Specified by:
serializationMethods
in interfaceClassDoc
- Returns:
- an array of
MethodDocImpl
that represents the serialization methods for this class.
-
serializableFields
public FieldDoc[] serializableFields()
Deprecated.Return the Serializable fields of class.Return either a list of default fields documented by
serial
tag
or return a singleFieldDoc
forserialPersistentField
member. There should be aserialField
tag for each Serializable field defined by anObjectStreamField
array component ofserialPersistentField
.- Specified by:
serializableFields
in interfaceClassDoc
- Returns:
- an array of
FieldDoc
for the Serializable fields of this class. - See Also:
definesSerializableFields()
,SerialFieldTagImpl
-
definesSerializableFields
public boolean definesSerializableFields()
Deprecated.Return true if Serializable fields are explicitly defined with the special class memberserialPersistentFields
.- Specified by:
definesSerializableFields
in interfaceClassDoc
- Returns:
- true if Serializable fields are explicitly defined with
the special class member
serialPersistentFields
. - See Also:
serializableFields()
,SerialFieldTagImpl
-
position
public SourcePosition position()
Deprecated.Return the source position of the entity, or null if no position is available.
-
-