|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxjavadoc.AbstractProgramElement
xjavadoc.AbstractClass
public abstract class AbstractClass
Base implementation of XClass.
Field Summary | |
---|---|
private java.util.List |
_allInterfaces
The implemented interfaces according to the hierarchy |
private java.util.List |
_allSubclasses
|
private java.util.List |
_constructors
|
private XPackage |
_containingPackage
|
private java.util.List |
_declaredInterfaces
The implemented interfaces according to the source |
private java.util.List |
_directSubclasses
|
private java.util.List |
_extendingInterfaces
|
private java.util.List |
_fields
|
private int |
_hash
|
private java.util.List |
_implementingClasses
|
private java.util.List |
_importedClasses
|
private java.util.List |
_importedClassNames
|
private java.util.List |
_importedPackages
|
private java.util.List |
_innerClasses
|
private boolean |
_isAnonymous
|
private boolean |
_isInterface
|
private java.util.List |
_methods
|
private java.lang.String |
_name
|
private java.util.Map |
_namedConstructors
|
private java.util.HashMap |
_namedMethods
|
private java.lang.String |
_qualifiedName
|
private XClass |
_superclass
|
private java.lang.String |
_transformedName
|
private java.lang.String |
_transformedQualifiedName
|
Fields inherited from class xjavadoc.AbstractProgramElement |
---|
EMPTY_LIST |
Constructor Summary | |
---|---|
protected |
AbstractClass(AbstractClass containingClass,
XTagFactory tagFactory)
|
protected |
AbstractClass(XJavaDoc xJavaDoc,
XTagFactory tagFactory)
|
Method Summary | |
---|---|
(package private) void |
addConstructor(XConstructor constructor)
Gets the Constructors attribute of the AbstractClass object |
(package private) void |
addField(XField field)
Gets the Fields attribute of the AbstractClass object |
(package private) void |
addImportedClass(java.lang.String importedClass)
Sets the ImportedClasses attribute of the AbstractClass object |
(package private) void |
addImportedPackage(java.lang.String importedPackage)
Sets the ImportedPackages attribute of the AbstractClass object |
protected void |
addInnerClass(XClass clazz)
|
(package private) void |
addInterface(java.lang.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) |
(package private) void |
addMethod(XMethod method)
Gets the Methods attribute of the AbstractClass object |
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object obj)
|
java.util.List |
getAllSubclasses()
Returns the (known) subclasses, regardless of how deep in the class hierarchy. |
XConstructor |
getConstructor(java.lang.String constructorNameWithSignature)
Gets the Constructor attribute of the AbstractClass object |
java.util.List |
getConstructors()
Gets the constructors. |
XPackage |
getContainingPackage()
Describe what the method does |
java.util.Collection |
getDeclaredInterfaces()
Returns the interfaces that are declared in the source code. |
java.util.List |
getDirectSubclasses()
Returns the (known) direct subclasses. |
java.util.List |
getExtendingInterfaces()
Return the (known) interfaces that extend this interface. |
XField |
getField(java.lang.String fieldName)
Returns an XField with the given name. |
java.util.List |
getFields()
Describe what the method does |
java.util.List |
getFields(boolean superclasses)
|
java.util.List |
getFields(org.apache.commons.collections.Predicate predicate,
boolean superclasses)
|
java.util.List |
getImplementingClasses()
Return the (known) classes that implement this interface. |
java.util.List |
getImportedClasses()
Describe what the method does |
java.util.List |
getImportedPackages()
Describe what the method does |
java.util.List |
getInnerClasses()
Describe what the method does |
java.util.List |
getInterfaces()
Returns all the implemented interfaces (if this is a class) or all the extended interfaces (if this is an interface) |
private java.util.List |
getMembers(boolean superclasses,
boolean forFields)
Returns all the fields or methods. |
XMethod |
getMethod(java.lang.String methodNameWithSignature)
|
XMethod |
getMethod(java.lang.String methodNameWithSignature,
boolean superclasses)
Returns an XMethod with the given name and parameters. |
java.util.List |
getMethods()
Returns all the methods, not including superclasses |
java.util.List |
getMethods(boolean superclasses)
Returns all the methods. |
java.util.List |
getMethods(org.apache.commons.collections.Predicate predicate,
boolean superclasses)
Returns all the methods that are accepted by the filter. |
java.util.List |
getMethodTags(java.lang.String tagName,
boolean superclasses)
Returns a collection of tags from the methods in this class (or superclasses). |
java.lang.String |
getName()
Get name |
java.lang.String |
getQualifiedName()
Describe what the method does |
XClass |
getSuperclass()
Describe what the method does |
XProgramElement |
getSuperElement()
Describe what the method does |
java.util.List |
getSuperInterfaceElements()
|
java.lang.String |
getTransformedName()
Gets the transformed class name, for example: Character$Subset |
java.lang.String |
getTransformedQualifiedName()
Gets the transformed qualified class name, for example: java.lang.Character$Subset |
java.lang.String |
getType()
Gets the type, e.g. |
int |
hashCode()
|
protected boolean |
hasImportedClasses()
|
protected boolean |
hasImportedPackages()
|
protected boolean |
hasInnerClasses()
|
private void |
initializeNamedConstructorsHashMap()
|
private void |
initializeNamedMethodsHashMap()
|
boolean |
isA(java.lang.String full_qualified_type_name)
Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName |
boolean |
isA(java.lang.String full_qualified_type_name,
boolean superclasses)
Returns true if we are subclass or implement the class/interface with the name classOrInterfaceName |
boolean |
isAnonymous()
Returns true if this class is anonymous. |
boolean |
isImplementingInterface(java.lang.String full_qualified_type_name)
Returns true if it implements full_qualified_type_name (or recursively superclasses implement). |
boolean |
isImplementingInterface(java.lang.String full_qualified_type_name,
boolean superclasses)
Returns true if it implements full_qualified_type_name (or recursively superclasses implement, if superclasses==true). |
boolean |
isInner()
Returns true if this is an inner class. |
boolean |
isInterface()
Gets the Interface attribute of the SourceClass object |
boolean |
isSubclassOf(java.lang.String full_qualified_type_name)
Returns true if the superclass (or recursively superclass of superclass) is full_qualified_type_name. |
boolean |
isSubclassOf(java.lang.String full_qualified_type_name,
boolean superclasses)
Returns true if the superclass (or recursively superclass of superclass, if superclasses==true) is full_qualified_type_name. |
long |
lastModified()
|
XClass |
qualify(java.lang.String unqualifiedClassName)
|
(package private) void |
reset()
|
(package private) void |
resolveImportedClasses()
|
java.lang.String |
save(java.io.File rootDir)
|
(package private) void |
setContainingPackage(java.lang.String containingPackage)
Sets the ContainingPackage attribute of the AbstractProgramElement object Use package name specified in class, and do not complain about directory struct. |
(package private) void |
setInterface(boolean flag)
Sets the Interface attribute of the SourceClass object |
(package private) void |
setName(java.lang.String name)
Sets the unqualified name of the class. |
(package private) void |
setQualifiedName(java.lang.String qualifiedName)
Sets the qualified name of the class. |
(package private) void |
setRealised(java.lang.String clazz)
This method is called for anonymous classes only. |
(package private) void |
setSuperclass(java.lang.String superclass)
Sets the SuperClass attribute of the SourceClass object |
java.lang.String |
toString()
|
void |
updateDoc()
update javadoc |
private void |
validate(XMember member)
|
Methods inherited from class xjavadoc.AbstractProgramElement |
---|
addModifier, getContainingAbstractClass, getContainingClass, getDoc, getModifiers, getModifierSpecifier, getTagFactory, getXJavaDoc, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, setToken |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface xjavadoc.XClass |
---|
getContainingClass, isAbstract, isPrimitive, isWriteable, saveNeeded, setDirty |
Methods inherited from interface xjavadoc.XProgramElement |
---|
getDoc, getModifiers, getModifierSpecifier, getXJavaDoc, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic |
Field Detail |
---|
private java.util.List _declaredInterfaces
private java.util.List _allInterfaces
private java.util.List _importedClasses
private java.util.List _importedClassNames
private java.util.List _importedPackages
private java.util.List _constructors
private java.util.Map _namedConstructors
private java.util.List _methods
private java.util.HashMap _namedMethods
private java.util.List _fields
private java.util.List _innerClasses
private XPackage _containingPackage
private boolean _isInterface
private boolean _isAnonymous
private XClass _superclass
private int _hash
private java.util.List _directSubclasses
private java.util.List _allSubclasses
private java.util.List _implementingClasses
private java.util.List _extendingInterfaces
private java.lang.String _name
private java.lang.String _transformedName
private java.lang.String _qualifiedName
private java.lang.String _transformedQualifiedName
Constructor Detail |
---|
protected AbstractClass(AbstractClass containingClass, XTagFactory tagFactory)
protected AbstractClass(XJavaDoc xJavaDoc, XTagFactory tagFactory)
Method Detail |
---|
public final boolean isInterface()
isInterface
in interface XClass
public final boolean isA(java.lang.String full_qualified_type_name)
XClass
isA
in interface XClass
full_qualified_type_name
- The full qualified type name
public final boolean isA(java.lang.String full_qualified_type_name, boolean superclasses)
XClass
isA
in interface XClass
full_qualified_type_name
- The full qualified type namesuperclasses
- whether the isA search should search the
whole hierarchy
public final XMethod getMethod(java.lang.String methodNameWithSignature)
getMethod
in interface XClass
public final XMethod getMethod(java.lang.String methodNameWithSignature, boolean superclasses)
XClass
getMethod
in interface XClass
methodNameWithSignature
- Describe what the parameter doessuperclasses
- Looks in superclasses too if true
public final XConstructor getConstructor(java.lang.String constructorNameWithSignature)
getConstructor
in interface XClass
constructorNameWithSignature
- Describe what the parameter does
public final XField getField(java.lang.String fieldName)
getField
in interface XClass
fieldName
- Describe what the parameter does
public final java.util.List getImportedClasses()
getImportedClasses
in interface XClass
public final java.util.List getImportedPackages()
getImportedPackages
in interface XClass
public final java.util.List getMethods()
XClass
getMethods
in interface XClass
public final java.util.List getMethods(org.apache.commons.collections.Predicate predicate, boolean superclasses)
XClass
getMethods
in interface XClass
superclasses
- if true, include methods from superclasses too.
public final java.util.List getFields(org.apache.commons.collections.Predicate predicate, boolean superclasses)
public final java.util.List getMethods(boolean superclasses)
XClass
getMethods
in interface XClass
superclasses
- if true, include methods from superclasses and
interfaces too.
public final java.util.List getFields(boolean superclasses)
getFields
in interface XClass
public final java.util.List getFields()
getFields
in interface XClass
public final java.util.List getConstructors()
getConstructors
in interface XClass
public final boolean isSubclassOf(java.lang.String full_qualified_type_name)
XClass
isSubclassOf
in interface XClass
full_qualified_type_name
- Describe what the parameter does
public final boolean isImplementingInterface(java.lang.String full_qualified_type_name)
XClass
isImplementingInterface
in interface XClass
full_qualified_type_name
- Describe what the parameter does
public java.lang.String getType()
XClass
java.lang.String.class
or java.lang.Integer.TYPE
.
getType
in interface XClass
public boolean isInner()
XClass
isInner
in interface XClass
public boolean isSubclassOf(java.lang.String full_qualified_type_name, boolean superclasses)
XClass
isSubclassOf
in interface XClass
full_qualified_type_name
- Describe what the parameter doessuperclasses
- Looks in superclasses too if true
public boolean isImplementingInterface(java.lang.String full_qualified_type_name, boolean superclasses)
XClass
isImplementingInterface
in interface XClass
full_qualified_type_name
- Describe what the parameter doessuperclasses
- Looks in superclasses too if true
public java.lang.String getName()
Named
getName
in interface Named
public java.lang.String getQualifiedName()
getQualifiedName
in interface XClass
public java.lang.String getTransformedName()
Character$Subset
getTransformedName
in interface XClass
public java.lang.String getTransformedQualifiedName()
java.lang.Character$Subset
getTransformedQualifiedName
in interface XClass
public java.util.List getInterfaces()
getInterfaces
in interface XClass
public java.util.Collection getDeclaredInterfaces()
public XClass getSuperclass()
getSuperclass
in interface XClass
public java.util.List getDirectSubclasses()
XClass
getDirectSubclasses
in interface XClass
public java.util.List getAllSubclasses()
XClass
getAllSubclasses
in interface XClass
public java.util.List getImplementingClasses()
XClass
getImplementingClasses
in interface XClass
public java.util.List getExtendingInterfaces()
XClass
getExtendingInterfaces
in interface XClass
public XPackage getContainingPackage()
getContainingPackage
in interface XClass
getContainingPackage
in interface XProgramElement
getContainingPackage
in class AbstractProgramElement
public java.util.List getInnerClasses()
getInnerClasses
in interface XClass
public XProgramElement getSuperElement()
getSuperElement
in interface XProgramElement
public java.util.List getSuperInterfaceElements()
getSuperInterfaceElements
in interface XProgramElement
public boolean isAnonymous()
XClass
isAnonymous
in interface XClass
public java.util.List getMethodTags(java.lang.String tagName, boolean superclasses)
XClass
getMethodTags
in interface XClass
XTag
. If no tags are found, an empty
List is returned.public final int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
compareTo
in class AbstractProgramElement
public final java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String save(java.io.File rootDir) throws java.io.IOException
save
in interface XClass
java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public XClass qualify(java.lang.String unqualifiedClassName)
qualify
in interface XClass
public long lastModified()
lastModified
in interface XClass
public void updateDoc()
updateDoc
in interface XProgramElement
updateDoc
in class AbstractProgramElement
protected final boolean hasImportedClasses()
protected final boolean hasInnerClasses()
protected final boolean hasImportedPackages()
protected void addInnerClass(XClass clazz)
final void setQualifiedName(java.lang.String qualifiedName)
qualifiedName
- The new QualifiedName valuefinal void setContainingPackage(java.lang.String containingPackage)
containingPackage
- The new ContainingPackage valuefinal void setInterface(boolean flag)
flag
- The new Interface valuefinal void setSuperclass(java.lang.String superclass)
superclass
- The new Superclass valuefinal void setRealised(java.lang.String clazz)
clazz
- void setName(java.lang.String name)
name
- The new Name valuefinal void addInterface(java.lang.String interfaceName)
interfaceName
- Describe the method parametervoid resolveImportedClasses()
void addImportedClass(java.lang.String importedClass)
importedClass
- Describe the method parametervoid addImportedPackage(java.lang.String importedPackage)
importedPackage
- Describe the method parametervoid addConstructor(XConstructor constructor)
constructor
- Describe the method parametervoid addField(XField field)
field
- Describe the method parametervoid addMethod(XMethod method)
method
- Describe the method parametervoid reset()
reset
in class AbstractProgramElement
private final java.util.List getMembers(boolean superclasses, boolean forFields)
forFields
- true if you want the fields, false if you want methodssuperclasses
-
private final void validate(XMember member) throws java.lang.IllegalStateException
java.lang.IllegalStateException
private void initializeNamedMethodsHashMap()
private void initializeNamedConstructorsHashMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |