I would like to use a BeanWrapper (or similar) to access properties of objects contained in a map, somewhat like this:
Person p = new Person (...);
Map bean = new HashMap();
bean.put ("user", p);
BeanWrapper wrapper = new BeanWrapper (bean)
// Set property on person
wrapper.set ("user.fullName", "Eirik Lygre")
This does not currently work, and there is an open JIRA-request for it (https://jira.springsource.org/browse/SPR-2058; BeanWrapper does not support objects that are maps/arrays/lists themselves). My question is therefore as follows:
- Is there a well-known workaround, ie through configuring or subclassing the BeanWrapper, or creating some sort of magic around it?
- Is there any other Spring-related technology that will do this for me?
- Is there any other non-spring related technology that will do this for me?