我正在使用AspectJ来监控Android应用。我的AspectJ代码是这样的 -
public aspect Tester {
pointcut methodCalls():
execution(* com.example.buttontestaspect..*(..))&& !within(com.example.buttontestaspect.Tester);
before(): methodCalls(){
String n = thisJoinPointStaticPart.getSignature().toString();
//Gives the package and class
// Here I also want to get the context of that class
}
}
在上面的代码中,当执行String'n'时,我也想获得该类的上下文。我如何实现这一目标?