Skip to content

AnnotationUtils.findAnnotation() should look for annotations on annotations [SPR-5085] #9758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Aug 14, 2008 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Bruno Navert opened SPR-5085 and commented

When searching for annotations using AnnotationUtils.findAnnotation(), it should be possible to detect annotations that are present on other annotations.

For instance, imagine a controller class annotated with @MyController, where @MyController is a custom annotation that I created. @MyController is itself annotated with @Controller (it is a specialization of controller). It would be nice if the call AnnotationUtils.findAnnotation(handlerType, Controller.class) could, in addition to searching interfaces and super-classes, also look at the annotations (MyController) and look for the requested @Controller annotation there.


Affects: 2.5.4

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for the suggestion! As of 3.0 M3, custom stereotype annotations can be meta-annotated with specialized stereotypes such as @Service, @Controller etc as well, with the same runtime effect as when using @Service, @Controller etc directly.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants