gpt4 book ai didi

java - Spring AOP setAdvice 仅在一种特定方法上

转载 作者:搜寻专家 更新时间:2023-11-01 01:23:17 24 4
gpt4 key购买 nike

我有以下类(class):

package x.y.z;

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

public void {
//do somethinng
}

}

现在我想只在方法 someMethod(SomeObject object, int param1)

上设置 @PointCut

我该怎么做?

更新我正在尝试

@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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com