我有以下类(class):

package x.y.z;

public class MyClass{
public void someMethod(SomeObject object){
//do somethinng
}

public void {
//do somethinng
}

}

现在我只想在@PointCut方法上设置someMethod(SomeObject object, int param1)
我该怎么做?

我正在尝试更新
@Pointcut("execution(x.y.z.MyClass.someMethod(x.y.z.SomeObject))") but I'm getting not well formed pointcut exception.

最佳答案

切入点应为:

target(x.y.z.MyClass) && execution(<RETURN TYPE> someMethod(x.y.z.SomeObject))

关于java - Spring AOP setAdvice仅针对一种特定方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8290071/

10-11 21:39