Base implementation of XClass.
_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
_implementingClasses
private List _implementingClasses
_importedClassNames
private List _importedClassNames
_importedClasses
private List _importedClasses
_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
addConstructor
(package private) void addConstructor(XConstructor constructor)
Gets the Constructors attribute of the AbstractClass object
constructor
- Describe the method parameter
addField
(package private) void addField(XField field)
Gets the Fields attribute of the AbstractClass object
field
- Describe the method parameter
addImportedClass
(package private) void addImportedClass(String importedClass)
Sets the ImportedClasses attribute of the AbstractClass object
importedClass
- Describe the method parameter
addImportedPackage
(package private) void addImportedPackage(String importedPackage)
Sets the ImportedPackages attribute of the AbstractClass object
importedPackage
- Describe the method parameter
addInnerClass
protected void addInnerClass(XClass clazz)
addInterface
(package private) 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)
interfaceName
- Describe the method parameter
addMethod
(package private) void addMethod(XMethod method)
Gets the Methods attribute of the AbstractClass object
method
- Describe the method parameter
equals
public boolean equals(Object obj)
getConstructor
public final XConstructor getConstructor(String constructorNameWithSignature)
Gets the Constructor attribute of the AbstractClass object
- getConstructor in interface XClass
constructorNameWithSignature
- Describe what the parameter does
getConstructors
public final List getConstructors()
Gets the constructors.
- getConstructors in interface XClass
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.
getField
public final XField getField(String fieldName)
Returns an XField with the given name. Example: getField("id");
- getField in interface XClass
fieldName
- Describe what the parameter does
getFields
public final List getFields()
Describe what the method does
- getFields in interface XClass
- Describe the return value for method for return value
getFields
public final List getFields(Predicate predicate,
boolean superclasses)
getFields
public final List getFields(boolean superclasses)
- getFields in interface XClass
getImportedClasses
public final List getImportedClasses()
Describe what the method does
- getImportedClasses in interface XClass
- Describe the return value for method for return value
getImportedPackages
public final List getImportedPackages()
Describe what the method does
- getImportedPackages in interface XClass
- Describe the return value for method for return value
getInnerClasses
public List getInnerClasses()
Describe what the method does
- getInnerClasses in interface XClass
- 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)
- getInterfaces in interface XClass
- Describe the return value for method for return value
getMembers
private final List getMembers(boolean superclasses,
boolean forFields)
Returns all the fields or methods.
superclasses
- forFields
- true if you want the fields, false if you want methods
getMethod
public final XMethod getMethod(String methodNameWithSignature,
boolean superclasses)
- getMethod in interface XClass
getMethodTags
public List getMethodTags(String tagName,
boolean superclasses)
- getMethodTags in interface XClass
getMethods
public final List getMethods(Predicate predicate,
boolean superclasses)
- getMethods in interface XClass
getMethods
public final List getMethods(boolean superclasses)
- getMethods in interface XClass
getQualifiedName
public String getQualifiedName()
Describe what the method does
- getQualifiedName in interface XClass
- Describe the return value for method for return value
getSuperclass
public XClass getSuperclass()
Describe what the method does
- getSuperclass in interface XClass
- Describe the return value for method for return value
getTransformedName
public String getTransformedName()
Gets the transformed class name, for example: Character$Subset
- getTransformedName in interface XClass
- the transformed class name.
getTransformedQualifiedName
public String getTransformedQualifiedName()
Gets the transformed qualified class name, for example: java.lang.Character$Subset
- getTransformedQualifiedName in interface XClass
- the transformed qualified class name.
hasImportedClasses
protected final boolean hasImportedClasses()
hasImportedPackages
protected final boolean hasImportedPackages()
hasInnerClasses
protected final boolean hasInnerClasses()
hashCode
public int hashCode()
initializeNamedConstructorsHashMap
private void initializeNamedConstructorsHashMap()
initializeNamedMethodsHashMap
private void initializeNamedMethodsHashMap()
isA
public final boolean isA(String full_qualified_type_name)
- isA in interface XClass
isA
public final boolean isA(String full_qualified_type_name,
boolean superclasses)
- isA in interface XClass
isImplementingInterface
public boolean isImplementingInterface(String full_qualified_type_name,
boolean superclasses)
- isImplementingInterface in interface XClass
isInterface
public final boolean isInterface()
Gets the Interface attribute of the SourceClass object
- isInterface in interface XClass
isSubclassOf
public final boolean isSubclassOf(String full_qualified_type_name)
- isSubclassOf in interface XClass
isSubclassOf
public boolean isSubclassOf(String full_qualified_type_name,
boolean superclasses)
- isSubclassOf in interface XClass
resolveImportedClasses
(package private) void resolveImportedClasses()
save
public String save(File rootDir)
throws IOException
- save in interface XClass
setContainingPackage
(package private) 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.
containingPackage
- The new ContainingPackage value
setInterface
(package private) final void setInterface(boolean flag)
Sets the Interface attribute of the SourceClass object
flag
- The new Interface value
setName
(package private) void setName(String name)
Sets the unqualified name of the class. Should only be called on objects
that represent inner classes.
name
- The new Name value
setQualifiedName
(package private) final void setQualifiedName(String qualifiedName)
Sets the qualified name of the class. Should only be called on objects that
represent outer classes.
qualifiedName
- The new QualifiedName value
setRealised
(package private) 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.
setSuperclass
(package private) final void setSuperclass(String superclass)
Sets the SuperClass attribute of the SourceClass object
superclass
- The new Superclass value
toString
public final String toString()
validate
private final void validate(XMember member)
throws IllegalStateException