Consider this @PointCut
which gets triggered if a method is annotated with an @Secure
annotation:
@Pointcut("execution(@Secure * *(..)) && @annotation(secure)")
public void accessOperation(final Access access) { }
This works perfectly well for methods like:
class Foo {
@Secure
public void secureMethod() { }
}
But is it possible to have a Pointcut
which also gets triggered when the annotation only exists in a superclass/interface like this?
interface Foo {
@Secure
public void secureMethod();
}
class SubFoo implements Foo {
@Override
public void secureMethod() { // <--- execution of this method should be caught
/* .... */
}
}
EDIT:
This seems to be very closely related to: @AspectJ pointcut for subclasses of a class with an annotation
The only difference is that they use a class-level annotation, whereas I need a method-level annotation.