public final class BeanUtil extends Object
| Constructor and Description |
|---|
BeanUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(Object from,
Object to)
Copy JavaBean property values from one object to another.
|
static void |
copy(Object from,
Object to,
boolean includeNull)
Copy JavaBean property values from one object to another.
|
static Object |
getAsValue(PropertyEditor pe,
String txt)
Helper method that gets the value using a PropertyEditor If the editor is a FastPropertyEditor then getAsValue is
called otherwise normal setAsText, getValue calls are made
|
static PropertyEditor |
getPropertyEditor(Class clazz)
Helper method to retrieve a property editor out of cache.
|
static void |
setProperties(Map from,
Object to)
Set JavaBean property values on an object with values taken from a map.
|
static void |
setProperty(String propertyName,
Object val,
Object obj)
Set a single JavaBean property value on an object.
|
static String |
toStringValue(Object obj)
Call toString on object.
|
public static void copy(Object from, Object to) throws IllegalArgumentException
from - the source objectto - the destination objectIllegalArgumentException - thrown if the copy fails for some reasonpublic static void copy(Object from, Object to, boolean includeNull) throws IllegalArgumentException
from - the source objectto - the destination objectincludeNull - whether null values are copied or notIllegalArgumentException - thrown if the copy fails for some reasonpublic static void setProperties(Map from, Object to) throws IllegalArgumentException
from - map of valuesto - the destination objectIllegalArgumentExceptionpublic static void setProperty(String propertyName, Object val, Object obj) throws IllegalArgumentException
propertyName - String representing the property or subpropertyval - the value to setobj - the object to set the property on.IllegalArgumentExceptionpublic static PropertyEditor getPropertyEditor(Class clazz)
public static Object getAsValue(PropertyEditor pe, String txt)
public static String toStringValue(Object obj)
Copyright © 2013 Atlassian. All Rights Reserved.