public abstract class BeanUtils extends Object
| Constructor and Description |
|---|
BeanUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
clone(T source)
浅克隆。Return a shadow cloned object.
|
static void |
copyProperties(Object source,
Object target)
把相同名称和类型的字段从源对象中复制到目标对象中去(目标对象中final字段除外)。 Copy same name and type field
value from source to target(except target final field).
|
static <T> T |
newInstance(Class<T> clazz)
返回一个给定类型的新实例。 Returns a newly allocated instance of the class represented
by this class.
|
static <T> T |
newInstance(Class<T> clazz,
Class<?>[] fieldTypes,
Object[] values)
根据给定的多个实例化参数类型和对应数据实例化指定类型的对象。Returns a newly allocated instance of the
class represented by this class use given constructor parameters class
type and constructor parameters value.
|
static <T> T |
newInstance(Class<T> clazz,
Class<?> fieldType,
Object value)
根据给定实例化参数类型和数据实例化指定类型的对象。 Returns a newly allocated instance of the class
represented by this class use given constructor parameters class type and
constructor parameters value.
|
public static <T> T clone(T source)
throws BeanInstantiationException
source - 源对象。source objectBeanInstantiationExceptionpublic static void copyProperties(Object source, Object target)
source - 源对象。source object.target - 目标对象。target object.public static <T> T newInstance(Class<T> clazz)
clazz - 想要实例化的类型。want to create instance class.public static <T> T newInstance(Class<T> clazz, Class<?> fieldType, Object value)
clazz - 想要实例化的类型。want to create instance class.fieldType - 构造函数的唯一参数类型。constructor single parameter class type.value - 构造函数的唯一参数数据。constructor single parameter value.public static <T> T newInstance(Class<T> clazz, Class<?>[] fieldTypes, Object[] values)
clazz - 想要实例化的类型。want to create instance class.fieldTypes - 、构造函数的参数类型的数组。constructor parameters class type.values - 、构造函数的参数数值的数组。constructor parameters value.Copyright © 2014. All rights reserved.