This is only the first cut of a utility to do it in an automated way:
TAGD result = new TAGD();
Map properties = BeanUtils.describe(result);
for (Object property : properties.keySet()) {
BeanUtils.setProperty(result, property.toString(), property.toString());
}
return result;
This works only if you have only strings in the bean.
BeanUtils is from Apache Commons.
1 comment:
There is jPopulator that can do that easily :
https://github.com/benas/jPopulator
Hope it helps.
Post a Comment