gpt4 book ai didi

java - spectj 切入点表达式执行或给出不一致的绑定(bind)

转载 作者:行者123 更新时间:2023-12-01 04:27:35 27 4
gpt4 key购买 nike

我有以下内容

@Pointcut("execution(* com.foo..*.*(..))")
public void logExecTimeAllMethods() {
}

//intercept all methods that are annotated with @LogExecTime
@Pointcut("@annotation(logExecTime)")
public void logExecTimeAnnotatedMethods(LogExecTime logExecTime) {
}

//add advice to above interceptors
@Around("logExecTimeAnnotatedMethods(logExecTime) || logExecTimeAllMethods()")
public Object logExecTime(ProceedingJoinPoint joinPoint, LogExecTime logExecTime) throws Throwable {

在logExecTime中如果我替换||使用 && 编译文件,但使用 ||我收到“绑定(bind)不一致”

最佳答案

您正在访问注释。只有当它存在时,这才是可能的,如果您使用 OR 结构,则不必这样做。如果它只是一个标记,则建议中不需要它。如果它包含您打算使用的有值(value)的信息,您应该在它自己的建议中处理这种情况。

关于java - spectj 切入点表达式执行或给出不一致的绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18381842/

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