Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
Extension annotations on Bean methods Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Extension annotations on Bean methods


    How can I put an annotation on a @Bean method, so I can post process the bean/beandef with the data in the annotation?

    If I try to post process the bean/factory in the standard way, I can't get an (easy) access to the annotation. @Bean#meta can't provide enough information in a robust way (meaning, without going into stringulation techniques).

    Thank you,

  • #2
    Hi Ittay,

    There is no such support right now, unfortunately. Perhaps if you spell out your particular use case, we might be able to find some other way of addressing it with JavaConfig?

    Or, you can feel free to create a new feature request (against the core Spring JIRA 'SPR' project) requesting that custom annotations be propagated through to the BeanDefinition objects that get registered when processing @Configuration classes. I'll can't make any promises as to whether it will be implemented, but a JIRA issue will be the right place to discuss it and solicit other feedback.

    It's an interesting idea, for sure. If a @Bean annotation is also annotated with @CustomAnno, it would be nice for a Bean[Factory]PostProcessor to be able to access that annotation instance and act upon it.


    • #3
      ok, created