Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pointcut with a class name pattern

test.core and I want an aspect around every class in that or a sub-package with the name pattern Service.

sth like this: "execution(public de.test.core..Service.*(..)" but it doesn t seem to work.

Is aspectJ even able to match to a class pattern?

like image 330
cloudnaut Avatar asked Oct 19 '22 01:10

cloudnaut


1 Answers

Match all methods defined in beans whose name ends with ‘Service’.

bean(*Service)

Match by Service pattern

@Pointcut("within(*..*Service)")
public void inServiceClass() {}
like image 109
GUISSOUMA Issam Avatar answered Oct 29 '22 13:10

GUISSOUMA Issam