我从@kriegaex遇到了answer,我无法理解。
我想理解的切入点表达式如下
@Around("execution(* (@MyAnnotation *).*(..)) || execution(@MyAnnotation * *(..))")
据我所知,此表达式将建议使用@MyAnnotation
注释的任何类或方法>
从reference documentation开始,execution
表达式的格式如下:
execution(modifiers-pattern? ret-type-pattern declaring-type-pattern?name-pattern(param-pattern) throws-pattern?)
基于此格式,以下表达式
execution(* (@MyAnnotation *).*(..))
可以解释为
ret-type-pattern is * declaring-type-pattern is any type with @MyAnnotation name-pattern is * param-pattern is ..
以
@MyAnnotation
注释的类建议任何方法调用。如果我错了,请纠正我。
对于此表达式
execution(@MyAnnotation * *(..))
我无法理解
modifiers-pattern
如何成为@MyAnnotation
?这是如何工作的?
我从@kriegaex那里得到了一个答案,我无法理解。我试图理解的切入点表达式是以下@Around(“ execution(*(@MyAnnotation *)。*(..))|| ...
这是一个有趣的问题。有人正在阅读文档,哇! :)