I came across an answer from @kriegaex , which I am unable to comprehend.
The pointcut expression I am trying to understand is the following
@Around("execution(* (@MyAnnotation *).*(..)) || execution(@MyAnnotation * *(..))")
As I understand , this expression will advice any class or method annotated with @MyAnnotation
From the reference documentation , the format of an execution
expression is as follows:
execution(modifiers-pattern? ret-type-pattern declaring-type-pattern?name-pattern(param-pattern)
throws-pattern?)
Based on this format , the following expression
execution(* (@MyAnnotation *).*(..))
can be explained as
ret-type-pattern is *
declaring-type-pattern is any type with @MyAnnotation
name-pattern is *
param-pattern is ..
to advice any method call in a class annotated with @MyAnnotation
. Please correct me if I am wrong .
And for this expression
execution(@MyAnnotation * *(..))
I am unable to understand how modifiers-pattern
can be @MyAnnotation
? How does this work ?