| java.lang.Object org.apache.commons.beanutils.BeanUtils
All known Subclasses: org.apache.commons.beanutils.locale.LocaleBeanUtils,
BeanUtils | public class BeanUtils (Code) | | Utility methods for populating JavaBeans properties via reflection.
The implementations are provided by
BeanUtilsBean .
These static utility methods use the default instance.
More sophisticated behaviour can be provided by using a BeanUtilsBean instance.
author: Craig R. McClanahan author: Ralph Schaer author: Chris Audley author: Rey Francois author: Gregor Rayman version: $Revision: 555824 $ $Date: 2007-07-13 01:27:15 +0100 (Fri, 13 Jul 2007) $ See Also: BeanUtilsBean |
Method Summary | |
public static Object | cloneBean(Object bean) | public static void | copyProperties(Object dest, Object orig) | public static void | copyProperty(Object bean, String name, Object value) | public static Map | describe(Object bean) | public static String[] | getArrayProperty(Object bean, String name) | public static int | getDebug() | public static String | getIndexedProperty(Object bean, String name) | public static String | getIndexedProperty(Object bean, String name, int index) Return the value of the specified indexed property of the specified
bean, as a String. | public static String | getMappedProperty(Object bean, String name) | public static String | getMappedProperty(Object bean, String name, String key) | public static String | getNestedProperty(Object bean, String name) | public static String | getProperty(Object bean, String name) | public static String | getSimpleProperty(Object bean, String name) | public static boolean | initCause(Throwable throwable, Throwable cause) If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
Parameters: throwable - The throwable. Parameters: cause - The cause of the throwable. | public static void | populate(Object bean, Map properties) | public static void | setDebug(int newDebug) | public static void | setProperty(Object bean, String name, Object value) |
copyProperties | public static void copyProperties(Object dest, Object orig) throws IllegalAccessException, InvocationTargetException(Code) | | Copy property values from the origin bean to the destination bean
for all cases where the property names are the same.
For more details see BeanUtilsBean .
Parameters: dest - Destination bean whose properties are modified Parameters: orig - Origin bean whose properties are retrieved exception: IllegalAccessException - if the caller does not haveaccess to the property accessor method exception: IllegalArgumentException - if the dest ororig argument is null or if the dest property type is different from the source type and the relevantconverter has not been registered. exception: InvocationTargetException - if the property accessor methodthrows an exception See Also: BeanUtilsBean.copyProperties |
getDebug | public static int getDebug()(Code) | | The debug static property is no longer used
debug property |
initCause | public static boolean initCause(Throwable throwable, Throwable cause)(Code) | | If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
Parameters: throwable - The throwable. Parameters: cause - The cause of the throwable. true if the cause was initialized, otherwise false. |
populate | public static void populate(Object bean, Map properties) throws IllegalAccessException, InvocationTargetException(Code) | | Populate the JavaBeans properties of the specified bean, based on
the specified name/value pairs.
For more details see BeanUtilsBean .
Parameters: bean - JavaBean whose properties are being populated Parameters: properties - Map keyed by property name, with thecorresponding (String or String[]) value(s) to be set exception: IllegalAccessException - if the caller does not haveaccess to the property accessor method exception: InvocationTargetException - if the property accessor methodthrows an exception See Also: BeanUtilsBean.populate |
setDebug | public static void setDebug(int newDebug)(Code) | | The debug static property is no longer used
Parameters: newDebug - debug property |
|
|