1
是否有可能知道哪些方法在AspectJ中被切入點覆蓋?切入點覆蓋哪些方法?
對這個問題的背景是,我有一個涵蓋了所有方法(除了它自己)一個切入點:
pointcut traceMethods() : (execution(* *(..))&& !cflow(within(MethodTrace)));
我希望能夠創建一個用於覆蓋每一個方法的方法的簽名名單一旦應用程序啓動,通過切入點。這可能嗎?
pointcut traceMethods() : (execution(* *(..))&& !cflow(within(MethodTrace)));
before() : traceMethods()
{
// Holds the signature the method intercepted by the pointcut traceMethods()
String s = thisJoinPointStaticPart.getSignature().toString();
// do something with string 's'
}
更多關於它的信息here:
你解決了你的問題嗎? – dreamcrash