用注释注释的方法的方面用另一个注释注释

Aspect for method annotated with annotation which are annotated with another annotation

是否可以使用 Spring AOP 为具有注释的方法和类型制作切入点,这些注释用某些注释进行了注释。 这是我的自定义注释:

@AccessRestriction
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface HasPermission {
}

它用这个注解进行了注解:

@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface AccessRestriction {
}

那么是否可以创建切点来处理所有方法,这些方法用任何用 AccessRestriction 注释的注释进行注释。

我找到了解决方案。

我做了这样的切入点:

 within(@(@test.security.access.AccessRestriction *) *) ||
 execution(@(@test.security.access.AccessRestriction *) * *(..))