abc.aspectj.visit
Class AccessorMethods
java.lang.Object
abc.aspectj.visit.AccessorMethods
public class AccessorMethods
- extends java.lang.Object
Container class for storing accessor methods related to an aspect.
AccessorDecl has an instance of this as a member.
We have several kinds of accessor methods - field getter and setter methods, method dispatch accessors,
and methods to access the this pointer of textually enclosing classes.
You can create an accessor method (or obtain an existing one, if it was created earlier) by calling
one of the accessor*()
methods with the appropriate arguments. Most things are taken care
of automatically - methods are registered with MethodCategory using the right values etc. The only
thing that needs to be done is to invoke addAllSootMethods()
from the inter-type adjuster
in order to insert the method bodies into the corresponding classes.
- Author:
- Pavel Avgustinov
Method Summary |
Call |
accessorDispatch(AJNodeFactory nf,
AJTypeSystem ts,
Call c,
ClassType target,
Expr targetThis)
|
Call |
accessorGetter(AJNodeFactory nf,
AJTypeSystem ts,
Field f,
ClassType target,
Expr targetThis)
|
Call |
accessorQualSpecial(AJNodeFactory nf,
AJTypeSystem ts,
ClassType target,
Expr targetThis,
ClassType qualifier)
|
Call |
accessorQualSpecial(AJNodeFactory nf,
AJTypeSystem ts,
ClassType target,
Expr targetThis,
ClassType qualifier,
boolean qualThisNotSuper)
|
Call |
accessorSetter(AJNodeFactory nf,
AJTypeSystem ts,
Field f,
ClassType target,
Expr targetThis,
Expr value)
|
void |
addAllSootMethods()
|
protected AccessorDispatch |
createDispatcherObject(java.lang.String name,
MethodInstance mi,
ClassType target,
Position pos)
|
protected AccessorGet |
createGetterObject(java.lang.String name,
FieldInstance fi,
ClassType target,
Position pos)
|
protected AccessorQualSpecial |
createQualSpecialObject(java.lang.String name,
MethodInstance mi,
ClassType target,
ClassType qualifier,
Position pos,
boolean qualThisNotSuper)
|
protected AccessorSet |
createSetterObject(java.lang.String name,
FieldInstance fi,
ClassType target,
Position pos)
|
protected AccessorMethod |
findExistingAccessor(java.util.List accessors,
MemberInstance mi)
|
java.util.List |
getAccessorDispatchers()
|
java.util.List |
getAccessorGetters()
|
java.util.List |
getAccessorSetters()
|
java.util.List |
getQualSpecials()
|
protected java.lang.String |
tag()
Subclasses should override this to alter how names are generated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AccessorMethods
public AccessorMethods()
tag
protected java.lang.String tag()
- Subclasses should override this to alter how names are generated. For example, for a "Get" accessor
method, the name will be a unique ID based on "get$" + tag() + "$" + {fieldname}.
...although this behaviour is somewhat deprecated, as all accessors are created in this class.
Perhaps we should have a "tag" argument to the accessor* calls, so that we can have
get$super$f() and get$privileged$f() - it's certainly not important, though.
findExistingAccessor
protected AccessorMethod findExistingAccessor(java.util.List accessors,
MemberInstance mi)
createDispatcherObject
protected AccessorDispatch createDispatcherObject(java.lang.String name,
MethodInstance mi,
ClassType target,
Position pos)
accessorDispatch
public Call accessorDispatch(AJNodeFactory nf,
AJTypeSystem ts,
Call c,
ClassType target,
Expr targetThis)
createGetterObject
protected AccessorGet createGetterObject(java.lang.String name,
FieldInstance fi,
ClassType target,
Position pos)
accessorGetter
public Call accessorGetter(AJNodeFactory nf,
AJTypeSystem ts,
Field f,
ClassType target,
Expr targetThis)
createSetterObject
protected AccessorSet createSetterObject(java.lang.String name,
FieldInstance fi,
ClassType target,
Position pos)
accessorSetter
public Call accessorSetter(AJNodeFactory nf,
AJTypeSystem ts,
Field f,
ClassType target,
Expr targetThis,
Expr value)
createQualSpecialObject
protected AccessorQualSpecial createQualSpecialObject(java.lang.String name,
MethodInstance mi,
ClassType target,
ClassType qualifier,
Position pos,
boolean qualThisNotSuper)
accessorQualSpecial
public Call accessorQualSpecial(AJNodeFactory nf,
AJTypeSystem ts,
ClassType target,
Expr targetThis,
ClassType qualifier)
accessorQualSpecial
public Call accessorQualSpecial(AJNodeFactory nf,
AJTypeSystem ts,
ClassType target,
Expr targetThis,
ClassType qualifier,
boolean qualThisNotSuper)
getAccessorGetters
public java.util.List getAccessorGetters()
getAccessorSetters
public java.util.List getAccessorSetters()
getAccessorDispatchers
public java.util.List getAccessorDispatchers()
getQualSpecials
public java.util.List getQualSpecials()
addAllSootMethods
public void addAllSootMethods()