Results 1 to 2 of 2

Thread: Spring - java reflection

  1. #1
    Join Date
    Oct 2011
    Posts
    15

    Default Spring - java reflection

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

    Thanks

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    710

    Default

    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!

Posting Permissions

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