I would like to automatically bind properties from a java.util.Properties instance to the fields in an object.
Preferable something like this:
Properties props = ... // has for instance the property "url=http://localhost:8080
MyType myType = ...
PropertiesBinder.bind(props, myType);
assertEquals("http://localhost:8080", myType.getUrl());
It is not that hard to roll your own, but i wonder if someone already has done this?
BeanUtils.populate(object, map)Properties extends Hashtable implements Map, so you can use it in the above method.