xjavadoc

Class AbstractClass

public abstract class AbstractClass extends AbstractProgramElement implements XClass

Base implementation of XClass.

Author: Ara Abrahamian Aslak Hellesxy

UNKNOWN: 18. oktober 2002

Field Summary
List_allInterfaces
The implemented interfaces according to the hierarchy
List_allSubclasses
List_constructors
XPackage_containingPackage
List_declaredInterfaces
The implemented interfaces according to the source
List_directSubclasses
List_extendingInterfaces
List_fields
int_hash
List_implementingClasses
List_importedClasses
List_importedClassNames
List_importedPackages
List_innerClasses
boolean_isAnonymous
boolean_isInterface
List_methods
String_name
Map_namedConstructors
HashMap_namedMethods
String_qualifiedName
XClass_superclass
String_transformedName
String_transformedQualifiedName
Constructor Summary
protected AbstractClass(AbstractClass containingClass, XTagFactory tagFactory)
protected AbstractClass(XJavaDoc xJavaDoc, XTagFactory tagFactory)
Method Summary
voidaddConstructor(XConstructor constructor)
Gets the Constructors attribute of the AbstractClass object
voidaddField(XField field)
Gets the Fields attribute of the AbstractClass object
voidaddImportedClass(String importedClass)
Sets the ImportedClasses attribute of the AbstractClass object
voidaddImportedPackage(String importedPackage)
Sets the ImportedPackages attribute of the AbstractClass object
protected voidaddInnerClass(XClass clazz)
voidaddInterface(String interfaceName)
Adds an interface that this class implements (if this is a class) or an interface that this interface extends (if this is an interface)
voidaddMethod(XMethod method)
Gets the Methods attribute of the AbstractClass object
intcompareTo(Object o)
booleanequals(Object obj)
ListgetAllSubclasses()
XConstructorgetConstructor(String constructorNameWithSignature)
Gets the Constructor attribute of the AbstractClass object
ListgetConstructors()
Gets the constructors.
XPackagegetContainingPackage()
Describe what the method does
CollectiongetDeclaredInterfaces()
Returns the interfaces that are declared in the source code.
ListgetDirectSubclasses()
ListgetExtendingInterfaces()
XFieldgetField(String fieldName)
Returns an XField with the given name.
ListgetFields(Predicate predicate, boolean superclasses)
ListgetFields(boolean superclasses)
ListgetFields()
Describe what the method does
ListgetImplementingClasses()
ListgetImportedClasses()
Describe what the method does
ListgetImportedPackages()
Describe what the method does
ListgetInnerClasses()
Describe what the method does
ListgetInterfaces()
Returns all the implemented interfaces (if this is a class) or all the extended interfaces (if this is an interface)
ListgetMembers(boolean superclasses, boolean forFields)
Returns all the fields or methods.
XMethodgetMethod(String methodNameWithSignature)
XMethodgetMethod(String methodNameWithSignature, boolean superclasses)
ListgetMethods()
ListgetMethods(Predicate predicate, boolean superclasses)
ListgetMethods(boolean superclasses)
ListgetMethodTags(String tagName, boolean superclasses)
StringgetName()
StringgetQualifiedName()
Describe what the method does
XClassgetSuperclass()
Describe what the method does
XProgramElementgetSuperElement()
Describe what the method does
ListgetSuperInterfaceElements()
StringgetTransformedName()
Gets the transformed class name, for example: Character$Subset
StringgetTransformedQualifiedName()
Gets the transformed qualified class name, for example: java.lang.Character$Subset
StringgetType()
inthashCode()
protected booleanhasImportedClasses()
protected booleanhasImportedPackages()
protected booleanhasInnerClasses()
voidinitializeNamedConstructorsHashMap()
voidinitializeNamedMethodsHashMap()
booleanisA(String full_qualified_type_name)
booleanisA(String full_qualified_type_name, boolean superclasses)
booleanisAnonymous()
booleanisImplementingInterface(String full_qualified_type_name)
booleanisImplementingInterface(String full_qualified_type_name, boolean superclasses)
booleanisInner()
booleanisInterface()
Gets the Interface attribute of the SourceClass object
booleanisSubclassOf(String full_qualified_type_name)
booleanisSubclassOf(String full_qualified_type_name, boolean superclasses)
longlastModified()
XClassqualify(String unqualifiedClassName)
voidreset()
voidresolveImportedClasses()
Stringsave(File rootDir)
voidsetContainingPackage(String containingPackage)
Sets the ContainingPackage attribute of the AbstractProgramElement object Use package name specified in class, and do not complain about directory struct.
voidsetInterface(boolean flag)
Sets the Interface attribute of the SourceClass object
voidsetName(String name)
Sets the unqualified name of the class.
voidsetQualifiedName(String qualifiedName)
Sets the qualified name of the class.
voidsetRealised(String clazz)
This method is called for anonymous classes only.
voidsetSuperclass(String superclass)
Sets the SuperClass attribute of the SourceClass object
StringtoString()
voidupdateDoc()
update javadoc
voidvalidate(XMember member)

Field Detail

_allInterfaces

private List _allInterfaces
The implemented interfaces according to the hierarchy

_allSubclasses

private List _allSubclasses

_constructors

private List _constructors

_containingPackage

private XPackage _containingPackage

_declaredInterfaces

private List _declaredInterfaces
The implemented interfaces according to the source

_directSubclasses

private List _directSubclasses

_extendingInterfaces

private List _extendingInterfaces

_fields

private List _fields

_hash

private int _hash

_implementingClasses

private List _implementingClasses

_importedClasses

private List _importedClasses

_importedClassNames

private List _importedClassNames

_importedPackages

private List _importedPackages

_innerClasses

private List _innerClasses

_isAnonymous

private boolean _isAnonymous

_isInterface

private boolean _isInterface

_methods

private List _methods

_name

private String _name

_namedConstructors

private Map _namedConstructors

_namedMethods

private HashMap _namedMethods

_qualifiedName

private String _qualifiedName

_superclass

private XClass _superclass

_transformedName

private String _transformedName

_transformedQualifiedName

private String _transformedQualifiedName

Constructor Detail

AbstractClass

protected AbstractClass(AbstractClass containingClass, XTagFactory tagFactory)

AbstractClass

protected AbstractClass(XJavaDoc xJavaDoc, XTagFactory tagFactory)

Method Detail

addConstructor

void addConstructor(XConstructor constructor)
Gets the Constructors attribute of the AbstractClass object

Parameters: constructor Describe the method parameter

addField

void addField(XField field)
Gets the Fields attribute of the AbstractClass object

Parameters: field Describe the method parameter

addImportedClass

void addImportedClass(String importedClass)
Sets the ImportedClasses attribute of the AbstractClass object

Parameters: importedClass Describe the method parameter

addImportedPackage

void addImportedPackage(String importedPackage)
Sets the ImportedPackages attribute of the AbstractClass object

Parameters: importedPackage Describe the method parameter

addInnerClass

protected void addInnerClass(XClass clazz)

addInterface

final void addInterface(String interfaceName)
Adds an interface that this class implements (if this is a class) or an interface that this interface extends (if this is an interface)

Parameters: interfaceName Describe the method parameter

addMethod

void addMethod(XMethod method)
Gets the Methods attribute of the AbstractClass object

Parameters: method Describe the method parameter

compareTo

public final int compareTo(Object o)

equals

public boolean equals(Object obj)

getAllSubclasses

public List getAllSubclasses()

getConstructor

public final XConstructor getConstructor(String constructorNameWithSignature)
Gets the Constructor attribute of the AbstractClass object

Parameters: constructorNameWithSignature Describe what the parameter does

Returns: The Constructor value

getConstructors

public final List getConstructors()
Gets the constructors.

Returns: the constructors.

getContainingPackage

public XPackage getContainingPackage()
Describe what the method does

Returns: Describe the return value

getDeclaredInterfaces

public Collection getDeclaredInterfaces()
Returns the interfaces that are declared in the source code. This excludes any interfaces that might be implicitly implemented. This method is only useful for CodeUnit, which compares source codes, and should normally not be called.

Returns: A Collection of XClass

getDirectSubclasses

public List getDirectSubclasses()

getExtendingInterfaces

public List getExtendingInterfaces()

getField

public final XField getField(String fieldName)
Returns an XField with the given name. Example: getField("id");

Parameters: fieldName Describe what the parameter does

Returns: The Field value

getFields

public final List getFields(Predicate predicate, boolean superclasses)

getFields

public final List getFields(boolean superclasses)

getFields

public final List getFields()
Describe what the method does

Returns: Describe the return value for method for return value

getImplementingClasses

public List getImplementingClasses()

getImportedClasses

public final List getImportedClasses()
Describe what the method does

Returns: Describe the return value for method for return value

getImportedPackages

public final List getImportedPackages()
Describe what the method does

Returns: Describe the return value for method for return value

getInnerClasses

public List getInnerClasses()
Describe what the method does

Returns: Describe the return value

getInterfaces

public List getInterfaces()
Returns all the implemented interfaces (if this is a class) or all the extended interfaces (if this is an interface)

Returns: Describe the return value for method for return value

getMembers

private final List getMembers(boolean superclasses, boolean forFields)
Returns all the fields or methods.

Parameters: forFields true if you want the fields, false if you want methods superclasses

Returns: A List of XMember

getMethod

public final XMethod getMethod(String methodNameWithSignature)

getMethod

public final XMethod getMethod(String methodNameWithSignature, boolean superclasses)

getMethods

public final List getMethods()

getMethods

public final List getMethods(Predicate predicate, boolean superclasses)

getMethods

public final List getMethods(boolean superclasses)

getMethodTags

public List getMethodTags(String tagName, boolean superclasses)

getName

public String getName()

getQualifiedName

public String getQualifiedName()
Describe what the method does

Returns: Describe the return value for method for return value

getSuperclass

public XClass getSuperclass()
Describe what the method does

Returns: Describe the return value for method for return value

getSuperElement

public XProgramElement getSuperElement()
Describe what the method does

Returns: Describe the return value

getSuperInterfaceElements

public List getSuperInterfaceElements()

getTransformedName

public String getTransformedName()
Gets the transformed class name, for example: Character$Subset

Returns: the transformed class name.

getTransformedQualifiedName

public String getTransformedQualifiedName()
Gets the transformed qualified class name, for example: java.lang.Character$Subset

Returns: the transformed qualified class name.

getType

public String getType()

hashCode

public int hashCode()

hasImportedClasses

protected final boolean hasImportedClasses()

hasImportedPackages

protected final boolean hasImportedPackages()

hasInnerClasses

protected final boolean hasInnerClasses()

initializeNamedConstructorsHashMap

private void initializeNamedConstructorsHashMap()

initializeNamedMethodsHashMap

private void initializeNamedMethodsHashMap()

isA

public final boolean isA(String full_qualified_type_name)

isA

public final boolean isA(String full_qualified_type_name, boolean superclasses)

isAnonymous

public boolean isAnonymous()

isImplementingInterface

public final boolean isImplementingInterface(String full_qualified_type_name)

isImplementingInterface

public boolean isImplementingInterface(String full_qualified_type_name, boolean superclasses)

isInner

public boolean isInner()

isInterface

public final boolean isInterface()
Gets the Interface attribute of the SourceClass object

Returns: The Interface value

isSubclassOf

public final boolean isSubclassOf(String full_qualified_type_name)

isSubclassOf

public boolean isSubclassOf(String full_qualified_type_name, boolean superclasses)

lastModified

public long lastModified()

qualify

public XClass qualify(String unqualifiedClassName)

reset

void reset()

resolveImportedClasses

void resolveImportedClasses()

save

public String save(File rootDir)

setContainingPackage

final void setContainingPackage(String containingPackage)
Sets the ContainingPackage attribute of the AbstractProgramElement object Use package name specified in class, and do not complain about directory struct.

Parameters: containingPackage The new ContainingPackage value

setInterface

final void setInterface(boolean flag)
Sets the Interface attribute of the SourceClass object

Parameters: flag The new Interface value

setName

void setName(String name)
Sets the unqualified name of the class. Should only be called on objects that represent inner classes.

Parameters: name The new Name value

setQualifiedName

final void setQualifiedName(String qualifiedName)
Sets the qualified name of the class. Should only be called on objects that represent outer classes.

Parameters: qualifiedName The new QualifiedName value

setRealised

final void setRealised(String clazz)
This method is called for anonymous classes only. Anon classes come in 2 flavours. They either realise a class or an interface.

Parameters: clazz

setSuperclass

final void setSuperclass(String superclass)
Sets the SuperClass attribute of the SourceClass object

Parameters: superclass The new Superclass value

toString

public final String toString()

updateDoc

public void updateDoc()
update javadoc

validate

private final void validate(XMember member)