Method annotation inheritance

Viewed 991

So, my problem is the following, I'm using annotations to tag the methods of a class.

My main annotation is @Action and I need a stronger annotation for specific methods that is @SpecificAction.

All the methods annotated with @SpecificAction must be annotated as @Action. My idea is to have @SpecificAction annotated with @Action.

@Action
[other irrelevant annotations]
public @interface SpecificAction{}

with

@SpecificAction
public void specificMethod(){}

I would expect specificMethod.isAnnotationPresent(Action.class) to be true, but it isn't.

How could I make it so that the @Action annotation is "inherited"?

1 Answers
Related