Results 1 to 3 of 3

Thread: Extension annotations on Bean methods

  1. #1
    Join Date
    Jun 2005
    Posts
    17

    Default Extension annotations on Bean methods

    Hi,

    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,
    Ittay

  2. #2
    Join Date
    Apr 2007
    Posts
    307

    Default

    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.
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  3. #3
    Join Date
    Jun 2005
    Posts
    17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •