java.lang.Object | |
↳ | org.apache.commons.beanutils.BeanUtils |
Known Direct Subclasses |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clone a bean based on the available property getters and setters, even if the bean class itself does not implement Cloneable. | |||||||||||
Copy property values from the origin bean to the destination bean for all cases where the property names are the same. | |||||||||||
Copy the specified property value to the specified destination bean, performing any type conversion that is required. | |||||||||||
Create a cache.
| |||||||||||
Return the entire set of properties for which the specified bean provides a read method. | |||||||||||
Return the value of the specified array property of the specified bean, as a String array. | |||||||||||
Return whether a Map is fast
| |||||||||||
This method is deprecated.
BeanUtils now uses commons-logging for all log messages.
Use your favorite logging tool to configure logging for
this class.
| |||||||||||
Return the value of the specified indexed property of the specified bean, as a String. | |||||||||||
Return the value of the specified indexed property of the specified
bean, as a String.
| |||||||||||
Return the value of the specified mapped property of the specified
bean, as a String.
| |||||||||||
Return the value of the specified indexed property of the specified
bean, as a String.
| |||||||||||
Return the value of the (possibly nested) property of the specified name, for the specified bean, as a String. | |||||||||||
Return the value of the specified property of the specified bean, no matter which property reference format is used, as a String. | |||||||||||
Return the value of the specified simple property of the specified bean, converted to a String. | |||||||||||
If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
| |||||||||||
Populate the JavaBeans properties of the specified bean, based on the specified name/value pairs. | |||||||||||
Set whether fast on a Map
| |||||||||||
This method is deprecated.
BeanUtils now uses commons-logging for all log messages.
Use your favorite logging tool to configure logging for
this class.
| |||||||||||
Set the specified property value, performing type conversions as required to conform to the type of the destination property. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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
.
bean | Bean to be cloned |
---|
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InstantiationException | if a new instance of the bean's class cannot be instantiated |
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
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
.
dest | Destination bean whose properties are modified |
---|---|
orig | Origin bean whose properties are retrieved |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
IllegalArgumentException | if the dest or
orig argument is null or if the dest
property type is different from the source type and the relevant
converter has not been registered. |
InvocationTargetException | if the property accessor method throws an exception |
Copy the specified property value to the specified destination bean, performing any type conversion that is required.
For more details see BeanUtilsBean
.
bean | Bean on which setting is to be performed |
---|---|
name | Property name (can be nested/indexed/mapped/combo) |
value | Value to be set |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
Return the entire set of properties for which the specified bean provides a read method.
For more details see BeanUtilsBean
.
bean | Bean whose properties are to be extracted |
---|
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
Return the value of the specified array property of the specified bean, as a String array.
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | Name of the property to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
Return whether a Map is fast
map | The map |
---|
This method is 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
Return the value of the specified indexed property of the specified bean, as a String.
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | propertyname[index] of the property value
to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
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
.
bean | Bean whose property is to be extracted |
---|---|
name | Simple property name of the property value to be extracted |
index | Index of the property value to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | Simple property name of the property value to be extracted |
key | Lookup key of the property value to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | propertyname(index) of the property value
to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
Return the value of the (possibly nested) property of the specified name, for the specified bean, as a String.
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | Possibly nested name of the property to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
IllegalArgumentException | if a nested reference to a property returns null |
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
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
.
bean | Bean whose property is to be extracted |
---|---|
name | Possibly indexed and/or nested name of the property to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
Return the value of the specified simple property of the specified bean, converted to a String.
For more details see BeanUtilsBean
.
bean | Bean whose property is to be extracted |
---|---|
name | Name of the property to be extracted |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
NoSuchMethodException | if an accessor method for this property cannot be found |
If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
throwable | The throwable. |
---|---|
cause | The cause of the throwable. |
Populate the JavaBeans properties of the specified bean, based on the specified name/value pairs.
For more details see BeanUtilsBean
.
bean | JavaBean whose properties are being populated |
---|---|
properties | Map keyed by property name, with the corresponding (String or String[]) value(s) to be set |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |
Set whether fast on a Map
map | The map |
---|---|
fast | Whether it should be fast or not. |
This method is 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
newDebug | debug property |
---|
Set the specified property value, performing type conversions as required to conform to the type of the destination property.
For more details see BeanUtilsBean
.
bean | Bean on which setting is to be performed |
---|---|
name | Property name (can be nested/indexed/mapped/combo) |
value | Value to be set |
IllegalAccessException | if the caller does not have access to the property accessor method |
---|---|
InvocationTargetException | if the property accessor method throws an exception |