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, TreePath treePath)Deprecated.Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AnnotatedTypeasAnnotatedType()Deprecated.Returns null, as this is not an annotated type.AnnotationTypeDocasAnnotationTypeDoc()Deprecated.Return null (unless overridden), as this is not an annotation type.ClassDocasClassDoc()Deprecated.Return this type as a class, which it already is.ParameterizedTypeasParameterizedType()Deprecated.Return null, as this is not a class instantiation.TypeVariableasTypeVariable()Deprecated.Return null, as this is not a type variable.WildcardTypeasWildcardType()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.PackageDoccontainingPackage()Deprecated.Return the package that this class is contained in.booleandefinesSerializableFields()Deprecated.Return true if Serializable fields are explicitly defined with the special class memberserialPersistentFields.Stringdimension()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.ClassDocfindClass(String className)Deprecated.Find a class within the context of this class.ConstructorDocfindConstructor(String constrName, String[] paramTypes)Deprecated.Find constructor in this class.FieldDocfindField(String fieldName)Deprecated.Find a field in this class scope.MethodDocImplfindMethod(String methodName, String[] paramTypes)Deprecated.Find a method in this class scope.protected com.sun.tools.javac.code.Symbol.ClassSymbolgetContainingClass()Deprecated.Identify the containing classTypegetElementType()Deprecated.If this type is an array type, return the element type of the array.protected longgetFlags()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.booleanisAbstract()Deprecated.Return true if this class is abstractbooleanisClass()Deprecated.Return true if this is a class, not an interface.booleanisEnum()Deprecated.Return true if this is an enumeration.booleanisError()Deprecated.Return true if this is an error classbooleanisException()Deprecated.Return true if this is an exception classbooleanisExternalizable()Deprecated.Return true if this class implementsjava.io.Externalizable.booleanisIncluded()Deprecated.Return true if this class is included in the active set.booleanisInterface()Deprecated.Return true if this is an interface, but not an annotation type.booleanisOrdinaryClass()Deprecated.Return true if this is a ordinary class, not an enumeration, exception, an error, or an interface.booleanisPrimitive()Deprecated.Return false, as this is not a primitive type.booleanisSerializable()Deprecated.Return true if this class implementsjava.io.Serializable.booleanisSynthetic()Deprecated.Returns true if this class was synthesized by the compiler.booleanisThrowable()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.Stringmodifiers()Deprecated.Return the modifier string for this class.intmodifierSpecifier()Deprecated.Get the modifier specifier integer.Stringname()Deprecated.Return the class name without package qualifier - but with enclosing class qualifier - as a String.SourcePositionposition()Deprecated.Return the source position of the entity, or null if no position is available.StringqualifiedName()Deprecated.Return the qualified class name as a String.StringqualifiedTypeName()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.StringsimpleTypeName()Deprecated.Return the simple name of this type.booleansubclassOf(ClassDoc cd)Deprecated.Test whether this class is a subclass of the specified class.ClassDocsuperclass()Deprecated.Return the superclass of this classTypesuperclassType()Deprecated.Return the superclass of this class.StringtoString()Deprecated.Return the qualified name and any type parameters.StringtypeName()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:TypeIf this type is an array type, return the element type of the array. Otherwise, return null.- Specified by:
getElementTypein interfaceType- Returns:
- a
Typerepresenting the element type or null.
-
getFlags
protected long getFlags()
Deprecated.Returns the flags in terms of javac's flags- Specified by:
getFlagsin classProgramElementDocImpl
-
getContainingClass
protected com.sun.tools.javac.code.Symbol.ClassSymbol getContainingClass()
Deprecated.Identify the containing class- Specified by:
getContainingClassin 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:
isOrdinaryClassin interfaceDoc- Overrides:
isOrdinaryClassin 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:
isInterfacein interfaceDoc- Overrides:
isInterfacein classDocImpl- Returns:
- true if it represents a interface
-
isException
public boolean isException()
Deprecated.Return true if this is an exception class- Specified by:
isExceptionin interfaceDoc- Overrides:
isExceptionin 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:
isAbstractin 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:
isIncludedin interfaceDoc- Specified by:
isIncludedin 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:
containingPackagein interfaceProgramElementDoc- Overrides:
containingPackagein 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:
qualifiedNamein interfaceProgramElementDoc- Specified by:
qualifiedNamein 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:
qualifiedTypeNamein 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:
simpleTypeNamein 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:
typeParametersin 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:
typeParamTagsin 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:
modifiersin interfaceProgramElementDoc- Overrides:
modifiersin classProgramElementDocImpl- Returns:
- "public abstract".
-
modifierSpecifier
public int modifierSpecifier()
Deprecated.Description copied from class:ProgramElementDocImplGet the modifier specifier integer.- Specified by:
modifierSpecifierin interfaceProgramElementDoc- Overrides:
modifierSpecifierin classProgramElementDocImpl- Returns:
- Get the modifier specifier integer.
- See Also:
Modifier
-
superclass
public ClassDoc superclass()
Deprecated.Return the superclass of this class- Specified by:
superclassin 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 aClassDocor aParameterizedType.- Specified by:
superclassTypein 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:
subclassOfin 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:
interfacesin 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:
interfaceTypesin interfaceClassDoc- Returns:
- an array of interfaces, each represented by a
ClassDocor 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:
enumConstantsin 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:
constructorsin 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:
constructorsin 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:
innerClassesin 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:
innerClassesin 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:
importedClassesin 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:
importedPackagesin 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:
asClassDocin interfaceType- Returns:
- the
ClassDocof 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:
asAnnotationTypeDocin interfaceType- Returns:
- an
AnnotationTypeDocif 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:
asParameterizedTypein interfaceType- Returns:
- a
ParameterizedTypeif 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:
asTypeVariablein interfaceType- Returns:
- a
TypeVariableif 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:
asWildcardTypein interfaceType- Returns:
- a
WildcardTypeif 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:
asAnnotatedTypein interfaceType- Returns:
- a
AnnotatedTypeif 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:
isPrimitivein 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.Externalizableextendsjava.io.Serializable, Externalizable objects are also Serializable.- Specified by:
isSerializablein 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:
isExternalizablein 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:
serializationMethodsin interfaceClassDoc- Returns:
- an array of
MethodDocImplthat 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
serialtag
or return a singleFieldDocforserialPersistentFieldmember. There should be aserialFieldtag for each Serializable field defined by anObjectStreamFieldarray component ofserialPersistentField.- Specified by:
serializableFieldsin interfaceClassDoc- Returns:
- an array of
FieldDocfor 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:
definesSerializableFieldsin 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.
-
-