abc.weaving.aspectinfo
Class AccessorMethod

java.lang.Object
  extended by abc.weaving.aspectinfo.AccessorMethod
Direct Known Subclasses:
AccessorDispatch, AccessorGet, AccessorQualSpecial, AccessorSet

public abstract class AccessorMethod
extends java.lang.Object

Author:
Pavel Avgustinov Abstract class representing a generic accessor method - Set, Get or Dispatch. It stores all important information about a method, i.e. name, type, argument types, containing class etc., and provides facilities to get a Jimple representation of the method - overriding classes have to provide the body() method for constructing the method's jimple body.

Constructor Summary
AccessorMethod(java.lang.String name, ClassType target, Position pos)
           
 
Method Summary
 void addPosition(Position pos)
          Register the position of a further reference to this accessor method.
 void addSootMethod()
          Get the SootMethod representing this accessor method with the default modifiers (i.e.
abstract  void addSootMethod(int modifiers)
          Get the SootMethod representing this accessor method with the given modifiers.
 MemberInstance getMemberInstance()
          Get the MemberInstance associated with this accessor method (can be MethodInstance or FieldInstance).
 java.lang.String getName()
           
 ClassType getTarget()
           
abstract  void registerMethod(soot.SootMethod sm)
          Used to register the method's category with the static MethodCategory class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessorMethod

public AccessorMethod(java.lang.String name,
                      ClassType target,
                      Position pos)
Method Detail

addPosition

public void addPosition(Position pos)
Register the position of a further reference to this accessor method.


addSootMethod

public void addSootMethod()
Get the SootMethod representing this accessor method with the default modifiers (i.e. PUBLIC). This method also adds the generated method to the target class.


getMemberInstance

public MemberInstance getMemberInstance()
Get the MemberInstance associated with this accessor method (can be MethodInstance or FieldInstance).


getName

public java.lang.String getName()

getTarget

public ClassType getTarget()

addSootMethod

public abstract void addSootMethod(int modifiers)
Get the SootMethod representing this accessor method with the given modifiers. This method also adds the generated method to the target class.

Parameters:
modifiers - Modifiers to declare the method with - compare soot.Modifier

registerMethod

public abstract void registerMethod(soot.SootMethod sm)
Used to register the method's category with the static MethodCategory class. The default implementation (registering field get/set methods and dispatches) should be sufficient for most purposes.