1
내에서 객체를 가져 I이 다음 클래스 :AspectJ를이 포인트 컷
package Test;
public class A
{
private B b = new B()
{
@Override
public boolean someFunc() {return false;}
}
}
무엇 someFunc의 실행을 캡처하는 AspectJ의 포인트 컷이며, 동시에 외부 클래스 A에 대한 참조를 가져?
내가 시도 :pointcut captureExec(): within(Test.A) && execution(boolean Test.B+.someFunc());
before(): captureExec()
{
//here thisJoinPount.getTarget() returns object to class B,
//but I need reference object to the outer class A
}
감사
나는 당신이 컴파일 얻을 수 있지만
그것을 시도하지 않습니다. 다음 수정을 통해 "pointcut captureExec2 (Test.A a) : within (A) && execution (boolean Test.B + .someFunc()) && target (a); before (Test.A a) : captureExec (a)" 컴파일 할 수 있었지만 일치하지 않았습니다 ... – bob