Part 8 Pointcuts Examples

Опубликовано: 03 Май 2026
на канале: JavaAnatomy
486
3

Spring AOP
Uses AspectJ’s expression language to select where to apply advices

Designator
execution( [Modifiers] [ReturnType] [FullyQualifiedClassName].[MethodName] ([Arguments]) throws [ExceptionType])

The expression can contain wildcards like + and * and can be made of multiple expressions concatenated by boolean operators such as &&, ||, and so forth.
E.g.
execution(pattern) && execution(pattern) || execution(pattern)

The + wildcard specifies that the method to advise can also be found in subclasses . The + for an interface , means pointcut expression matches the methods in all implementation classes.