-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Ability to query an ApplicationContext for annotations on a bean [SPR-12929] #17522
Comments
Andres Almiray commented Harvesting qualifier information related to a bean or a set of beans can be done in the following way (a bit cumbersome but possible)
Two problems appear here:
I wish it was possible to reach out for |
Juergen Hoeller commented I'm afraid it's even less natural for Spring 5 to store and expose annotation instances than before. We do intend to introduce new retrieval facilities but primarily for functional-style filtering: #13532. Internally, we remain rather agnostic to annotation instances and process specific annotation metadata for our purposes only, which I'd like to keep up. Rather than downcasting |
Andres Almiray commented In Guice, every
In a sense, explicit Module configuration in Guice is similar to Spring's Java config via Being able to query annotations that may have been defined in the target type (option # 2 via |
Hi Is this still a requirement and there is a need for it? |
Andres Almiray opened SPR-12929 and commented
Currently the ApplicationContext is capable of resolving beans and beans names given an annotation but the reverse is not, that is, obtain an annotation given a bean name.
Currently annotation metadata is harvested and stored in
org.springframework.core.type.AnnotationMetadata
but the actual annotation is not.For reference, this feature was discussed with Jürgen at Voxxed Days Ticino 2015 in the context of a generic, external JSR-330 compatible API on top of Spring and Guice.
Affects: 4.1.6
Issue Links:
2 votes, 4 watchers
The text was updated successfully, but these errors were encountered: