在我的 AspectJ 项目中,我有如下代码:
public aspect MyAspect {
public Object MyInterface.getMyself() {
return this;
}
}
public interface MyInterface {
}
public class MyClassOne implements MyInterface {}
public class MyClassTwo implements MyInterface {}
那么,AspectJ 是如何在类型间声明中注入代码的呢?另外,有没有办法,而不是声明MyInterface.getMyself()'s Object,声明为this.getClass()或类似的东西,即注入MyClassOne和MyClassTwo适用的地方?