Announcement Announcement Module
Collapse
No announcement yet.
Spring - java reflection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring - java reflection

    Hi,
    Does spring use java reflection for IOC and any other config setting? If yes, please list some examples.

    Thanks

  • #2
    Of course it uses reflection...

    - for xml Ioc, just think of how the setter method (or the constructor) of the bean that gets the injection is called...yes the answer is obviously by using Java reflection (for setter, get name of property from xml -> prepend a "set" and switch the first letter to uppercase -> by using reflection, call a method that has that name passing property value);

    - for annotation IoC (@Autowired etc) well if you know how annotation processing works then you know it can't be done but by using reflection!

    Comment

    Working...
    X