Save This Page
Home » commons-beanutils-1.8.3-src » org.apache.commons.beanutils » [javadoc | source]
org.apache.commons.beanutils
public class: BeanUtils [javadoc | source]
java.lang.Object
   org.apache.commons.beanutils.BeanUtils

Direct Known Subclasses:
    LocaleBeanUtils

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.

Method from org.apache.commons.beanutils.BeanUtils Summary:
cloneBean,   copyProperties,   copyProperty,   createCache,   describe,   getArrayProperty,   getCacheFast,   getDebug,   getIndexedProperty,   getIndexedProperty,   getMappedProperty,   getMappedProperty,   getNestedProperty,   getProperty,   getSimpleProperty,   initCause,   populate,   setCacheFast,   setDebug,   setProperty
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.beanutils.BeanUtils Detail:
 public static Object cloneBean(Object bean) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException 

    Clone a bean based on the available property getters and setters, even if the bean class itself does not implement Cloneable.

    For more details see BeanUtilsBean.

 public static  void copyProperties(Object dest,
    Object orig) throws IllegalAccessException, InvocationTargetException 

    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.

 public static  void copyProperty(Object bean,
    String name,
    Object value) throws IllegalAccessException, InvocationTargetException 

    Copy the specified property value to the specified destination bean, performing any type conversion that is required.

    For more details see BeanUtilsBean.

 public static Map createCache() 
    Create a cache.
 public static Map describe(Object bean) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the entire set of properties for which the specified bean provides a read method.

    For more details see BeanUtilsBean.

 public static String[] getArrayProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified array property of the specified bean, as a String array.

    For more details see BeanUtilsBean.

 public static boolean getCacheFast(Map map) 
    Return whether a Map is fast
 public static int getDebug() 
Deprecated! BeanUtils - now uses commons-logging for all log messages. Use your favorite logging tool to configure logging for this class.

    The debug static property is no longer used
 public static String getIndexedProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified indexed property of the specified bean, as a String.

    For more details see BeanUtilsBean.

 public static String getIndexedProperty(Object bean,
    String name,
    int index) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 
    Return the value of the specified indexed property of the specified bean, as a String. The index is specified as a method parameter and must *not* be included in the property name expression

    For more details see BeanUtilsBean.

 public static String getMappedProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified indexed property of the specified bean, as a String.

    For more details see BeanUtilsBean.

 public static String getMappedProperty(Object bean,
    String name,
    String key) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified mapped property of the specified bean, as a String.

    For more details see BeanUtilsBean.

 public static String getNestedProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the (possibly nested) property of the specified name, for the specified bean, as a String.

    For more details see BeanUtilsBean.

 public static String getProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified property of the specified bean, no matter which property reference format is used, as a String.

    For more details see BeanUtilsBean.

 public static String getSimpleProperty(Object bean,
    String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException 

    Return the value of the specified simple property of the specified bean, converted to a String.

    For more details see BeanUtilsBean.

 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.
 public static  void populate(Object bean,
    Map properties) throws IllegalAccessException, InvocationTargetException 

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

    For more details see BeanUtilsBean.

 public static  void setCacheFast(Map map,
    boolean fast) 
    Set whether fast on a Map
 public static  void setDebug(int newDebug) 
Deprecated! BeanUtils - now uses commons-logging for all log messages. Use your favorite logging tool to configure logging for this class.

    The debug static property is no longer used
 public static  void setProperty(Object bean,
    String name,
    Object value) throws IllegalAccessException, InvocationTargetException 

    Set the specified property value, performing type conversions as required to conform to the type of the destination property.

    For more details see BeanUtilsBean.