对于 org.apache.commons.beanutils.BeanUtils 的一些学习

来源:互联网 发布:leslie 矩阵特征根 编辑:程序博客网 时间:2024/06/05 03:19

英文api 如下:

populate

public static void populate(Object bean,                            Map<String,? extends Object> properties)                     throws IllegalAccessException,                            InvocationTargetException

Populate the JavaBeans properties of the specified bean, based on the specified name/value pairs.

使用指定的 键值对 bean来填充 javaBeans属性!

For more details see BeanUtilsBean.

更多的细节 请看 BeanUtilsBean

Parameters:
参数
bean - JavaBean whose properties are being populated
参数 bean - 用来填充JavaBean的 bean
properties - Map keyed by property name, with the corresponding (String or String[]) value(s) to be set
参数 属性 - 键值对的Map  (key,value)
Throws:
异常抛出
IllegalAccessException - if the caller does not have access to the property accessor method
异常: 如果调用者没有访问属性和访问方法
InvocationTargetException - if the property accessor method throws an exception
异常:如果访问器方法抛出一个异常
See Also:
BeanUtilsBean.populate(java.lang.Object, java.util.Map<java.lang.String, ? extends java.lang.Object>)