BeanUtils.copyProperties() 用法
来源:互联网 发布:外星人笔记windows 编辑:程序博客网 时间:2024/06/01 13:05
官方手册解释
/*
Copy the property values of the given source bean into the target bean.
将source 赋值给 target
*/
public static void copyProperties(Object source, Object target) throws BeansException {
copyProperties(source, target, null, (String[]) null);
/*
Copy the property values of the given source bean into the target bean.
将source 赋值给 target
*/
public static void copyProperties(Object source, Object target) throws BeansException {
copyProperties(source, target, null, (String[]) null);
}
BeanUtils.copyProperties(obj1,obj2);
是将obj1的值赋给obj2
阅读全文