Announcement Announcement Module
Collapse
No announcement yet.
@Autowired for Lists of beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Autowired for Lists of beans

    Hi,

    I have currently found out that it is possible to autowire bean attributes of generic lists and correctly retrieve beans that match the generic type of the list. I am really curious on how this is implemented since type erasure does remove this type of information (as far as I understand it). Can anyone point me to the place in the source where this is implemented? I reviewed parts of listablebeanfactory but did not find the code at first glance. I would really appreciate any hints.

    Regards
    Benjamin

    Found answer to my question. I was confused with how type erasure works - generally all information that can be safely computed at compile time is also available at runtime. Here is a link to a pragmatic article that shows some simple code snippets. Sorry for polluting this forum but maybe this was helpful to at least one other person

    http://tutorials.jenkov.com/java-ref.../generics.html
    Last edited by bennidi; Feb 16th, 2012, 09:25 AM.
Working...
X