I'm writing a method supposed to retrieve all annotations of a specific method declaring class and its superclasses.
By using the method getAnnotations() on the declaring class, the resulting table contains only the declaring class annotations and the superclass annotations are ignored. If I remove the annotations of the declaring class, then the superclass annotation are present.
What am I missing here ? Thanks a lot for your help !
The simplified method retrieving the annotations :
public void check(Method invokedMethod) {
for (Annotation annotation : invokedMethod.getDeclaringClass().getAnnotations()) {
// Do something ...
}
}
(All annotations I'm trying the get have the @Inherited annotation)
Aucun commentaire:
Enregistrer un commentaire