【发布时间】:2014-09-13 11:34:29
【问题描述】:
org.apache.commons.beanutils.BeanUtils:
BeanUtils.populate(Object bean, Map<String,? extends Object> properties);
Populate the JavaBeans properties of the specified bean, based on the specified name/value pairs.
是否有 BeanUtils.populate 的递归版本?
class Person {
String name;
Address address;
}
class Address {
String street;
int number
}
所以在 Person 上调用填充,它也会填充地址(假设 Address 有一个默认构造函数)。
【问题讨论】:
标签: java apache-commons