public class PropertyUtils
extends java.lang.Object
Utility methods for using Java Reflection APIs to facilitate generic property getter and setter operations on Java objects.
The implementations for these methods are provided by PropertyUtilsBean
.
For more details see PropertyUtilsBean
.
PropertyUtilsBean
,
Resolver
Modifier and Type | Field and Description |
---|---|
private static int |
debug
Deprecated.
The
debug static property is no longer used |
static char |
INDEXED_DELIM
Deprecated.
The notation used for property name expressions is now
dependant on the
Resolver
implementation being used. |
static char |
INDEXED_DELIM2
Deprecated.
The notation used for property name expressions is now
dependant on the
Resolver
implementation being used. |
static char |
MAPPED_DELIM
Deprecated.
The notation used for property name expressions is now
dependant on the
Resolver
implementation being used. |
static char |
MAPPED_DELIM2
Deprecated.
The notation used for property name expressions is now
dependant on the
Resolver
implementation being used. |
static char |
NESTED_DELIM
Deprecated.
The notation used for property name expressions is now
dependant on the
Resolver
implementation being used. |
Constructor and Description |
---|
PropertyUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addBeanIntrospector(BeanIntrospector introspector)
Adds a
BeanIntrospector . |
static void |
clearDescriptors()
Clear any cached property descriptors information for all classes
loaded by any class loaders.
|
static void |
copyProperties(java.lang.Object dest,
java.lang.Object orig)
Copy property values from the "origin" bean to the "destination" bean
for all cases where the property names are the same (even though the
actual getter and setter methods might have been customized via
BeanInfo classes). |
static java.util.Map<java.lang.String,java.lang.Object> |
describe(java.lang.Object bean)
Return the entire set of properties for which the specified bean
provides a read method.
|
static int |
getDebug()
Deprecated.
The
debug static property is no longer used |
static java.lang.Object |
getIndexedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified indexed property of the specified
bean, with no type conversions.
|
static java.lang.Object |
getIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index)
Return the value of the specified indexed property of the specified
bean, with no type conversions.
|
static java.lang.Object |
getMappedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified mapped property of the
specified bean, with no type conversions.
|
static java.lang.Object |
getMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key)
Return the value of the specified mapped property of the specified
bean, with no type conversions.
|
static org.apache.commons.collections.FastHashMap |
getMappedPropertyDescriptors(java.lang.Class<?> beanClass)
Deprecated.
This method should not be exposed
|
static org.apache.commons.collections.FastHashMap |
getMappedPropertyDescriptors(java.lang.Object bean)
Deprecated.
This method should not be exposed
|
static java.lang.Object |
getNestedProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the (possibly nested) property of the specified
name, for the specified bean, with no type conversions.
|
static java.lang.Object |
getProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified property of the specified bean,
no matter which property reference format is used, with no
type conversions.
|
static java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.Object bean,
java.lang.String name)
Retrieve the property descriptor for the specified property of the
specified bean, or return
null if there is no such
descriptor. |
static java.beans.PropertyDescriptor[] |
getPropertyDescriptors(java.lang.Class<?> beanClass)
Retrieve the property descriptors for the specified class,
introspecting and caching them the first time a particular bean class
is encountered.
|
static java.beans.PropertyDescriptor[] |
getPropertyDescriptors(java.lang.Object bean)
Retrieve the property descriptors for the specified bean,
introspecting and caching them the first time a particular bean class
is encountered.
|
static java.lang.Class<?> |
getPropertyEditorClass(java.lang.Object bean,
java.lang.String name)
Return the Java Class repesenting the property editor class that has
been registered for this property (if any).
|
static java.lang.Class<?> |
getPropertyType(java.lang.Object bean,
java.lang.String name)
Return the Java Class representing the property type of the specified
property, or
null if there is no such property for the
specified bean. |
static java.lang.reflect.Method |
getReadMethod(java.beans.PropertyDescriptor descriptor)
Return an accessible property getter method for this property,
if there is one; otherwise return
null . |
static java.lang.Object |
getSimpleProperty(java.lang.Object bean,
java.lang.String name)
Return the value of the specified simple property of the specified
bean, with no type conversions.
|
static java.lang.reflect.Method |
getWriteMethod(java.beans.PropertyDescriptor descriptor)
Return an accessible property setter method for this property,
if there is one; otherwise return
null . |
static boolean |
isReadable(java.lang.Object bean,
java.lang.String name)
Return
true if the specified property name identifies
a readable property on the specified bean; otherwise, return
false . |
static boolean |
isWriteable(java.lang.Object bean,
java.lang.String name)
Return
true if the specified property name identifies
a writeable property on the specified bean; otherwise, return
false . |
static boolean |
removeBeanIntrospector(BeanIntrospector introspector)
Removes the specified
BeanIntrospector . |
static void |
resetBeanIntrospectors()
Resets the registered
BeanIntrospector objects to the initial default
state. |
static void |
setDebug(int newDebug)
Deprecated.
The
debug static property is no longer used |
static void |
setIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index,
java.lang.Object value)
Sets the value of the specified indexed property of the specified
bean, with no type conversions.
|
static void |
setIndexedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Sets the value of the specified indexed property of the specified
bean, with no type conversions.
|
static void |
setMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Sets the value of the specified mapped property of the
specified bean, with no type conversions.
|
static void |
setMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key,
java.lang.Object value)
Sets the value of the specified mapped property of the specified
bean, with no type conversions.
|
static void |
setNestedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Sets the value of the (possibly nested) property of the specified
name, for the specified bean, with no type conversions.
|
static void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set the value of the specified property of the specified bean,
no matter which property reference format is used, with no
type conversions.
|
static void |
setSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set the value of the specified simple property of the specified bean,
with no type conversions.
|
@Deprecated public static final char INDEXED_DELIM
Resolver
implementation being used.@Deprecated public static final char INDEXED_DELIM2
Resolver
implementation being used.@Deprecated public static final char MAPPED_DELIM
Resolver
implementation being used.@Deprecated public static final char MAPPED_DELIM2
Resolver
implementation being used.@Deprecated public static final char NESTED_DELIM
Resolver
implementation being used.@Deprecated private static int debug
debug
static property is no longer used@Deprecated public static int getDebug()
debug
static property is no longer useddebug
static property is no longer used@Deprecated public static void setDebug(int newDebug)
debug
static property is no longer useddebug
static property is no longer usednewDebug
- debug propertypublic static void clearDescriptors()
For more details see PropertyUtilsBean
.
PropertyUtilsBean.clearDescriptors()
public static void resetBeanIntrospectors()
BeanIntrospector
objects to the initial default
state.public static void addBeanIntrospector(BeanIntrospector introspector)
BeanIntrospector
. This object is invoked when the
property descriptors of a class need to be obtained.introspector
- the BeanIntrospector
to be added (must
not be nulljava.lang.IllegalArgumentException
- if the argument is nullpublic static boolean removeBeanIntrospector(BeanIntrospector introspector)
BeanIntrospector
.introspector
- the BeanIntrospector
to be removedBeanIntrospector
existed and
could be removed, false otherwisepublic static void copyProperties(java.lang.Object dest, java.lang.Object orig) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Copy property values from the "origin" bean to the "destination" bean
for all cases where the property names are the same (even though the
actual getter and setter methods might have been customized via
BeanInfo
classes).
For more details see PropertyUtilsBean
.
dest
- Destination bean whose properties are modifiedorig
- Origin bean whose properties are retrievedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if the dest
or
orig
argument is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.copyProperties(java.lang.Object, java.lang.Object)
public static java.util.Map<java.lang.String,java.lang.Object> describe(java.lang.Object bean) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the entire set of properties for which the specified bean provides a read method.
For more details see PropertyUtilsBean
.
bean
- Bean whose properties are to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.describe(java.lang.Object)
public static java.lang.Object getIndexedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified indexed property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- propertyname[index]
of the property value
to be extractedjava.lang.IndexOutOfBoundsException
- if the specified index
is outside the valid range for the underlying propertyjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getIndexedProperty(Object,String)
public static java.lang.Object getIndexedProperty(java.lang.Object bean, java.lang.String name, int index) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified indexed property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- Simple property name of the property value to be extractedindex
- Index of the property value to be extractedjava.lang.IndexOutOfBoundsException
- if the specified index
is outside the valid range for the underlying propertyjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getIndexedProperty(Object,String, int)
public static java.lang.Object getMappedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified mapped property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- propertyname(key)
of the property value
to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getMappedProperty(Object,String)
public static java.lang.Object getMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.String key) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified mapped property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- Mapped property name of the property value to be extractedkey
- Key of the property value to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getMappedProperty(Object,String, String)
@Deprecated public static org.apache.commons.collections.FastHashMap getMappedPropertyDescriptors(java.lang.Class<?> beanClass)
Return the mapped property descriptors for this bean class.
For more details see PropertyUtilsBean
.
beanClass
- Bean class to be introspectedPropertyUtilsBean.getMappedPropertyDescriptors(Class)
@Deprecated public static org.apache.commons.collections.FastHashMap getMappedPropertyDescriptors(java.lang.Object bean)
Return the mapped property descriptors for this bean.
For more details see PropertyUtilsBean
.
bean
- Bean to be introspectedPropertyUtilsBean.getMappedPropertyDescriptors(Object)
public static java.lang.Object getNestedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the (possibly nested) property of the specified name, for the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- Possibly nested name of the property to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nullNestedNullException
- if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getNestedProperty(java.lang.Object, java.lang.String)
public static java.lang.Object getProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified property of the specified bean, no matter which property reference format is used, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- Possibly indexed and/or nested name of the property
to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getProperty(java.lang.Object, java.lang.String)
public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Retrieve the property descriptor for the specified property of the
specified bean, or return null
if there is no such
descriptor.
For more details see PropertyUtilsBean
.
bean
- Bean for which a property descriptor is requestedname
- Possibly indexed and/or nested name of the property for
which a property descriptor is requestedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getPropertyDescriptor(java.lang.Object, java.lang.String)
public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class<?> beanClass)
Retrieve the property descriptors for the specified class, introspecting and caching them the first time a particular bean class is encountered.
For more details see PropertyUtilsBean
.
beanClass
- Bean class for which property descriptors are requestedjava.lang.IllegalArgumentException
- if beanClass
is nullPropertyUtilsBean.getPropertyDescriptors(Class)
public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Object bean)
Retrieve the property descriptors for the specified bean, introspecting and caching them the first time a particular bean class is encountered.
For more details see PropertyUtilsBean
.
bean
- Bean for which property descriptors are requestedjava.lang.IllegalArgumentException
- if bean
is nullPropertyUtilsBean.getPropertyDescriptors(Object)
public static java.lang.Class<?> getPropertyEditorClass(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the Java Class repesenting the property editor class that has been registered for this property (if any).
For more details see PropertyUtilsBean
.
bean
- Bean for which a property descriptor is requestedname
- Possibly indexed and/or nested name of the property for
which a property descriptor is requestedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getPropertyEditorClass(Object,String)
public static java.lang.Class<?> getPropertyType(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the Java Class representing the property type of the specified
property, or null
if there is no such property for the
specified bean.
For more details see PropertyUtilsBean
.
bean
- Bean for which a property descriptor is requestedname
- Possibly indexed and/or nested name of the property for
which a property descriptor is requestedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getPropertyType(Object, String)
public static java.lang.reflect.Method getReadMethod(java.beans.PropertyDescriptor descriptor)
Return an accessible property getter method for this property,
if there is one; otherwise return null
.
For more details see PropertyUtilsBean
.
descriptor
- Property descriptor to return a getter forPropertyUtilsBean.getReadMethod(PropertyDescriptor)
public static java.lang.Object getSimpleProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Return the value of the specified simple property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be extractedname
- Name of the property to be extractedjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if the property name
is nested or indexedjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.getSimpleProperty(java.lang.Object, java.lang.String)
public static java.lang.reflect.Method getWriteMethod(java.beans.PropertyDescriptor descriptor)
Return an accessible property setter method for this property,
if there is one; otherwise return null
.
For more details see PropertyUtilsBean
.
descriptor
- Property descriptor to return a setter forPropertyUtilsBean.getWriteMethod(PropertyDescriptor)
public static boolean isReadable(java.lang.Object bean, java.lang.String name)
Return true
if the specified property name identifies
a readable property on the specified bean; otherwise, return
false
.
For more details see PropertyUtilsBean
.
bean
- Bean to be examined (may be a DynaBean
name
- Property name to be evaluatedtrue
if the property is readable,
otherwise false
java.lang.IllegalArgumentException
- if bean
or name
is null
PropertyUtilsBean.isReadable(java.lang.Object, java.lang.String)
public static boolean isWriteable(java.lang.Object bean, java.lang.String name)
Return true
if the specified property name identifies
a writeable property on the specified bean; otherwise, return
false
.
For more details see PropertyUtilsBean
.
bean
- Bean to be examined (may be a DynaBean
name
- Property name to be evaluatedtrue
if the property is writeable,
otherwise false
java.lang.IllegalArgumentException
- if bean
or name
is null
PropertyUtilsBean.isWriteable(java.lang.Object, java.lang.String)
public static void setIndexedProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Sets the value of the specified indexed property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be modifiedname
- propertyname[index]
of the property value
to be modifiedvalue
- Value to which the specified property element
should be setjava.lang.IndexOutOfBoundsException
- if the specified index
is outside the valid range for the underlying propertyjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setIndexedProperty(Object, String, Object)
public static void setIndexedProperty(java.lang.Object bean, java.lang.String name, int index, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Sets the value of the specified indexed property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be setname
- Simple property name of the property value to be setindex
- Index of the property value to be setvalue
- Value to which the indexed property element is to be setjava.lang.IndexOutOfBoundsException
- if the specified index
is outside the valid range for the underlying propertyjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setIndexedProperty(Object, String, Object)
public static void setMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Sets the value of the specified mapped property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be setname
- propertyname(key)
of the property value
to be setvalue
- The property value to be setjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setMappedProperty(Object, String, Object)
public static void setMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.String key, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Sets the value of the specified mapped property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be setname
- Mapped property name of the property value to be setkey
- Key of the property value to be setvalue
- The property value to be setjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setMappedProperty(Object, String, String, Object)
public static void setNestedProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Sets the value of the (possibly nested) property of the specified name, for the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be modifiedname
- Possibly nested name of the property to be modifiedvalue
- Value to which the property is to be setjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if a nested reference to a
property returns nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setNestedProperty(java.lang.Object, java.lang.String, java.lang.Object)
public static void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Set the value of the specified property of the specified bean, no matter which property reference format is used, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be modifiedname
- Possibly indexed and/or nested name of the property
to be modifiedvalue
- Value to which this property is to be setjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setProperty(java.lang.Object, java.lang.String, java.lang.Object)
public static void setSimpleProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
Set the value of the specified simple property of the specified bean, with no type conversions.
For more details see PropertyUtilsBean
.
bean
- Bean whose property is to be modifiedname
- Name of the property to be modifiedvalue
- Value to which the property should be setjava.lang.IllegalAccessException
- if the caller does not have
access to the property accessor methodjava.lang.IllegalArgumentException
- if bean
or
name
is nulljava.lang.IllegalArgumentException
- if the property name is
nested or indexedjava.lang.reflect.InvocationTargetException
- if the property accessor method
throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this
propety cannot be foundPropertyUtilsBean.setSimpleProperty(java.lang.Object, java.lang.String, java.lang.Object)
Copyright (c) 2000-2008 - Apache Software Foundation