|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectaspoev.interpreter.base.Element
aspoev.interpreter.base.ClassDeclarationElement
This class defines meta classes in the AspOEv framework. It houses inheritance and version derivation relationships, as well as members, i.e. fields and methods. Moreover, this class defines functionality for referencing fields and invoking methods, as it resolves declared and inherited members.
| Field Summary | |
protected pJ.jasmine.ListOfObject |
advice
|
protected TypeReferenceElement |
baseType
|
protected ClassDeclarationElement |
derivedVersion
|
protected pJ.jasmine.ListOfObject |
differences
|
protected pJ.jasmine.Hashtab |
fieldTable
|
protected boolean |
isWorkingVersion
|
protected MethodTable |
methodTable
|
protected pJ.jasmine.ListOfObject |
subclasses
|
protected pJ.jasmine.ListOfObject |
superclasses
|
protected TypeReferenceElement |
type
|
| Fields inherited from class aspoev.interpreter.base.Element |
parent |
| Fields inherited from interface pJ.jasmine.PRI |
DELETECHANGE, MODIFYCHANGE, NOCHANGE |
| Constructor Summary | |
ClassDeclarationElement()
Creates a new, empty meta class with no members or supertypes. |
|
ClassDeclarationElement(ClassDeclarationElement baseVersion)
Creates a new meta class from the argument meta class declaration. |
|
| Method Summary | |
protected void |
activateMemberTables()
|
void |
addAdvice(RuntimePrimitive rp)
|
ExceptionIterator |
addField(FieldDeclarationElement newField)
Adds a field to the meta class. |
ExceptionIterator |
addField(TypeReferenceElement fieldType,
java.lang.String fieldName)
Adds a field to the meta class. |
ExceptionIterator |
addMember(MemberElement member)
Adds a member (field or method) to the class. |
ExceptionIterator |
addMethod(MethodDeclarationElement newMethod)
Adds a method to the meta class. |
ExceptionIterator |
addParameter(MethodDeclarationElement method,
TypeReferenceElement paramType,
java.lang.String paramName)
The same as 'addParameter(MethodDeclarationElement, TypeReferenceElement, String, Integer)', only the final parameter specifying position is omitted and the parameter is simply appended to the parameter list. |
ExceptionIterator |
addParameter(MethodDeclarationElement method,
TypeReferenceElement paramType,
java.lang.String paramName,
java.lang.Integer position)
Adds a parameter to the argument method. |
void |
addSubclass(TypeReferenceElement newSubtype)
Informs this metaclass that another meta class has extended it. |
ExceptionIterator |
addSuperclass(TypeReferenceElement newSupertype)
Adds a super class to this meta class. |
ExceptionIterator |
changeFieldName(java.lang.String oldName,
java.lang.String newName)
|
ExceptionIterator |
changeFieldType(java.lang.String fieldName,
TypeReferenceElement newType)
Alters a field by changing it's type. |
ExceptionIterator |
changeMethodName(MethodDeclarationElement method,
java.lang.String newName)
|
ExceptionIterator |
changeParameterName(MethodDeclarationElement method,
java.lang.Integer position,
java.lang.String newName)
|
ExceptionIterator |
changeParameterType(MethodDeclarationElement method,
java.lang.Integer position,
TypeReferenceElement newType)
|
ExceptionIterator |
changeReturnType(MethodDeclarationElement method,
TypeReferenceElement newType)
|
java.lang.Object |
clone()
|
boolean |
derivesFrom(TypeReferenceElement type)
Returns true if this meta class extends the argument type, false otherwise. |
protected java.lang.Object |
executeElement()
|
void |
finalizeVersion()
Finalizes a meta class which is a working version. |
pJ.jasmine.ListOfObject |
getAllDerived()
Returns a pJ.jasmine.ListOfObject of all types that derive from this meta class. |
java.util.Collection |
getChildrenByType(java.lang.Class childClass)
|
java.lang.String |
getClassName()
Returns the name of the meta class, as defined by its type. |
TypeReferenceElement |
getClassType()
Returns the fully qualified type of the meta class. |
java.lang.String |
getCodeString()
|
ConstructorDeclarationElement |
getConstructor(TypeReferenceElement[] paramTypes)
Returns the constructor with the specified parameter types. |
java.util.Map |
getDeclaredFields()
Retuns a map of all meta field declared by this meta class. |
java.util.Collection |
getDeclaredMethods()
Returns a java.util.Collection of all meta methods declared by this meta class. |
void |
getDeclaredMethods(java.util.Collection methods)
Adds all declared methods to the argument java.util.Collection |
FieldDeclarationElement |
getField(int uniqueID)
Retrieves a field by its unique identifier. |
FieldDeclarationElement |
getField(java.lang.String handle)
Returns the meta field specified by the argument handle. |
java.util.Map |
getFields()
Returns a java.util.Map of all meta fields defined by this meta class and all of its super types. |
protected java.util.Collection |
getLocalMemberUse(MemberElement member)
|
java.util.Collection |
getMemberUse(MemberElement member)
Queries meta methods and returns a java.util.Collection of meta methods which use the supplied member. |
MethodDeclarationElement |
getMethod(java.lang.String methodName)
|
MethodDeclarationElement |
getMethod(java.lang.String methodName,
TypeReferenceElement[] argTypes)
Retrieves the meta method matching the argument method name and types. |
java.lang.Object |
getRValue()
|
java.util.Set |
getTypeDependencies()
Returns a java.util.Set of all types this meta class depends on. |
ClassDeclarationElement |
getWorkingVersion()
Returns the working version derived from this meta class, if there is one. |
boolean |
hasSubtype(TypeReferenceElement type)
Returns true if the argument type derives from this type directly, alse otherwise. |
boolean |
hasSupertype(TypeReferenceElement type)
Returns true if this meta class derives directly from the argument type, false otherwise. |
boolean |
isWorkingVersion()
Returns true if this meta class is a working version and has not been finalized, false otherwise. |
TypeReferenceElement |
mergeInto(ClassDeclarationElement otherClass)
Merges this meta class with the argument meta class. |
TypeReferenceElement |
mergeInto(TypeReferenceElement otherType)
The same as 'mergeInto(ClassDeclarationElement)', only the meta class is referenced through its type. |
ExceptionIterator |
removeField(java.lang.String fieldName)
|
ExceptionIterator |
removeMethod(MethodDeclarationElement method)
|
ExceptionIterator |
removeMethod(java.lang.String name,
TypeListElement types)
|
ExceptionIterator |
removeMethod(java.lang.String methodName,
TypeReferenceElement[] types)
|
ExceptionIterator |
removeParameter(MethodDeclarationElement method,
java.lang.Integer index)
|
void |
removeSubclass(TypeReferenceElement remove)
|
ExceptionIterator |
removeSuperclass(TypeReferenceElement remove)
|
ExceptionIterator |
renameClass(java.lang.String newName)
Changes the name of this meta class. |
ClassDeclarationElement |
startWorkingVersion()
|
java.lang.String |
toString()
|
boolean |
usesType(TypeReferenceElement type)
|
| Methods inherited from class aspoev.interpreter.base.Element |
execute, persist |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected TypeReferenceElement type
protected TypeReferenceElement baseType
protected MethodTable methodTable
protected pJ.jasmine.Hashtab fieldTable
protected pJ.jasmine.ListOfObject superclasses
protected pJ.jasmine.ListOfObject subclasses
protected pJ.jasmine.ListOfObject advice
protected pJ.jasmine.ListOfObject differences
protected boolean isWorkingVersion
protected transient ClassDeclarationElement derivedVersion
| Constructor Detail |
public ClassDeclarationElement()
public ClassDeclarationElement(ClassDeclarationElement baseVersion)
baseVersion - The meta class which the new meta class (new
version) derives from on the version derivation graph| Method Detail |
protected java.util.Collection getLocalMemberUse(MemberElement member)
public void addAdvice(RuntimePrimitive rp)
public ExceptionIterator addField(TypeReferenceElement fieldType,
java.lang.String fieldName)
fieldType - The type of the field to be addedfieldName - The name of the field to be addedpublic ExceptionIterator addField(FieldDeclarationElement newField)
newField - The field to be addedpublic ExceptionIterator addMethod(MethodDeclarationElement newMethod)
newMethod - The method to be addedpublic ExceptionIterator addMember(MemberElement member)
member - The member to be added
public ExceptionIterator addParameter(MethodDeclarationElement method,
TypeReferenceElement paramType,
java.lang.String paramName,
java.lang.Integer position)
method - The method to be alteredparamType - The type of the new parameterparamName - The name of the new Parameterposition - The 0-based position in the parameter list to add
the new parameter
public ExceptionIterator addParameter(MethodDeclarationElement method,
TypeReferenceElement paramType,
java.lang.String paramName)
method - The method to be alteredparamType - The type of the new parameterparamName - The name of the new Parameterpublic void addSubclass(TypeReferenceElement newSubtype)
public ExceptionIterator addSuperclass(TypeReferenceElement newSupertype)
newSupertype - The type this meta class is to extend
public ExceptionIterator changeFieldType(java.lang.String fieldName,
TypeReferenceElement newType)
fieldName - The name of the field to retypenewType - The new type of the field
public ExceptionIterator changeFieldName(java.lang.String oldName,
java.lang.String newName)
public ExceptionIterator changeMethodName(MethodDeclarationElement method,
java.lang.String newName)
public ExceptionIterator changeParameterType(MethodDeclarationElement method,
java.lang.Integer position,
TypeReferenceElement newType)
public ExceptionIterator changeParameterName(MethodDeclarationElement method,
java.lang.Integer position,
java.lang.String newName)
public ExceptionIterator changeReturnType(MethodDeclarationElement method,
TypeReferenceElement newType)
public java.lang.Object clone()
clone in class Elementprotected java.lang.Object executeElement()
executeElement in class Elementpublic void finalizeVersion()
public ConstructorDeclarationElement getConstructor(TypeReferenceElement[] paramTypes)
paramTypes - The parameter types of the desired constructorpublic java.lang.String getClassName()
public TypeReferenceElement getClassType()
public FieldDeclarationElement getField(java.lang.String handle)
handle - The name of the meta field to be returned
public FieldDeclarationElement getField(int uniqueID)
uniqueID - The identifier of the meta field
public MethodDeclarationElement getMethod(java.lang.String methodName,
TypeReferenceElement[] argTypes)
methodName - The name of the meta method to retrieveargTypes - The types of the parameters of the meta method to retrievepublic MethodDeclarationElement getMethod(java.lang.String methodName)
public java.util.Collection getDeclaredMethods()
public void getDeclaredMethods(java.util.Collection methods)
methods - The collection to recieve all declared meta methodspublic java.util.Map getFields()
public java.util.Map getDeclaredFields()
public pJ.jasmine.ListOfObject getAllDerived()
public java.util.Set getTypeDependencies()
public java.lang.Object getRValue()
getRValue in class Elementpublic ClassDeclarationElement getWorkingVersion()
public boolean derivesFrom(TypeReferenceElement type)
public boolean hasSubtype(TypeReferenceElement type)
public boolean hasSupertype(TypeReferenceElement type)
public boolean isWorkingVersion()
public TypeReferenceElement mergeInto(ClassDeclarationElement otherClass)
public TypeReferenceElement mergeInto(TypeReferenceElement otherType)
public ExceptionIterator renameClass(java.lang.String newName)
public ExceptionIterator removeField(java.lang.String fieldName)
public ExceptionIterator removeParameter(MethodDeclarationElement method,
java.lang.Integer index)
public java.util.Collection getMemberUse(MemberElement member)
member - The member whose use should be searched for
public ExceptionIterator removeMethod(java.lang.String name,
TypeListElement types)
public ExceptionIterator removeMethod(java.lang.String methodName,
TypeReferenceElement[] types)
public ExceptionIterator removeMethod(MethodDeclarationElement method)
public void removeSubclass(TypeReferenceElement remove)
public ExceptionIterator removeSuperclass(TypeReferenceElement remove)
public ClassDeclarationElement startWorkingVersion()
public boolean usesType(TypeReferenceElement type)
public java.lang.String toString()
toString in class Elementpublic java.util.Collection getChildrenByType(java.lang.Class childClass)
getChildrenByType in class Elementpublic java.lang.String getCodeString()
getCodeString in class Elementprotected void activateMemberTables()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||