Main Source: http://howtodoinjava.com/spring/spring-aop/writing-spring-aop-aspectj-pointcut-expressions-with-examples/
1. Method Label Matching mode
Assume that the interface Employeemanager interface is defined.
1)
Execution (* com.howtodoinjava.employeemanager.* (..))
The above pointcut expression can match all the methods in the Employeemanger interface.
2)
When the tangent method and the Employeemanager interface are within the same package, if the pointcut expression matches all of the methods, the expression can be changed to:
Execution (* employeemanager.* (..))
3) All public methods that match the Employeemanager interface.
Execution (Public * employeemanager.* (..))
4) match the permissions in the Employeemanager interface to public and return all methods of type Employeedto.
Execution (public employeedto employeemanager.* (..))
5) All methods that match the permissions in the Employeemanager interface to public and return a type of employeedto, and the first parameter is the Employeedto type.
execution(
public
EmployeeDTO EmployeeManager.*(EmployeeDTO, ..))
6) All methods that match the permissions in the Employeemanager interface to public, the return type is Employeedto, and the parameters are explicitly defined as Employeedto,integer.
Execution (Public employeedto employeemanager.* (Employeedto, Integer))
2. Type Label matching mode
1) match all the methods in all types under the Com.howtodoinjava package.
Within (com.howtodoinjava.*)
2) match all the methods in the Com.howtodoinjava package and all types under its sub-package.
Within (Com.howtodoinjava. *)
3) match all the methods under one class for the other package.
Within (Com.howtodoinjava.EmployeeManagerImpl)
4) match all methods under one class under the same package.
Within (Employeemanagerimpl)
5) match all the methods of all inheritors under an interface.
Within (employeemanagerimpl+)
3. Bean Name Matching mode
Matches all methods in the beans ending with the manager.
Bean (*manager)
4. Pointcut Expression Stitching
In AspectJ, pointcut expressions can be spliced by &&,| |,! and other operators.
Bean (*manager) | | Bean (*dao)
This example shows all the methods in the beans that match the end of the manager or end with DAO.
Spring AOP AspectJ Pointcut Expression Example