PropertyUtil

public final class PropertyUtil extends PropertyUtils

The PropertyUtil util class provides the same method like org.apache.commons.beanutils.PropertyUtils and two additional methods for safe writing and reading property in the given bean.

Methods

copyProperties

public static void copyProperties(Object target, Object object)

copyProperties

public static void copyProperties(Object target, Object object, Set<String> fieldsToUpdate)

getPropertyDescriptors

public static PropertyDescriptor[] getPropertyDescriptors(Object bean)

safeGetProperty

public static Object safeGetProperty(Object bean, String name)

safeGetPropertyType

public static Class<?> safeGetPropertyType(Object bean, String name)

safeSetCollectionProperty

public static void safeSetCollectionProperty(Object bean, String name, Collection values)

safeSetProperty

public static void safeSetProperty(Object bean, String name, Object value)