AspectJ中target,this和within的区别
首先,AspectJ官方怎么描述这三个关键字:
this(SomeType):when the object currently executing (i.e. this) is of type SomeType
当前执行对象是否是某种类型
target(SomeType):when the target object is of type SomeType
目标对象是否是某种类型
within(MyClass):when the executing code belongs to class MyClass
当前执行代码是否属于某个类
within只支持类,而target和this支持类和接口,target会获取继承关系,而this不会,只会获取目标对象