Class PropertyUtils
- java.lang.Object
-
- org.apache.commons.beanutils.PropertyUtils
-
public class PropertyUtils extends java.lang.ObjectUtility 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 seePropertyUtilsBean.- See Also:
PropertyUtilsBean,Resolver
-
-
Field Summary
Fields Modifier and Type Field Description private static intdebugDeprecated.Thedebugstatic property is no longer usedstatic charINDEXED_DELIMDeprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.static charINDEXED_DELIM2Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.static charMAPPED_DELIMDeprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.static charMAPPED_DELIM2Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.static charNESTED_DELIMDeprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.
-
Constructor Summary
Constructors Constructor Description PropertyUtils()Deprecated.Will be private in 2.0.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddBeanIntrospector(BeanIntrospector introspector)Adds aBeanIntrospector.static voidclearDescriptors()Clear any cached property descriptors information for all classes loaded by any class loaders.static voidcopyProperties(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 viaBeanInfoclasses).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 intgetDebug()Deprecated.Thedebugstatic property is no longer usedstatic java.lang.ObjectgetIndexedProperty(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.ObjectgetIndexedProperty(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.ObjectgetMappedProperty(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.ObjectgetMappedProperty(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.FastHashMapgetMappedPropertyDescriptors(java.lang.Class<?> beanClass)Deprecated.This method should not be exposedstatic org.apache.commons.collections.FastHashMapgetMappedPropertyDescriptors(java.lang.Object bean)Deprecated.This method should not be exposedstatic java.lang.ObjectgetNestedProperty(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.ObjectgetProperty(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.PropertyDescriptorgetPropertyDescriptor(java.lang.Object bean, java.lang.String name)Retrieve the property descriptor for the specified property of the specified bean, or returnnullif 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, ornullif there is no such property for the specified bean.static java.lang.reflect.MethodgetReadMethod(java.beans.PropertyDescriptor descriptor)Return an accessible property getter method for this property, if there is one; otherwise returnnull.static java.lang.ObjectgetSimpleProperty(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.MethodgetWriteMethod(java.beans.PropertyDescriptor descriptor)Return an accessible property setter method for this property, if there is one; otherwise returnnull.static booleanisReadable(java.lang.Object bean, java.lang.String name)Returntrueif the specified property name identifies a readable property on the specified bean; otherwise, returnfalse.static booleanisWriteable(java.lang.Object bean, java.lang.String name)Returntrueif the specified property name identifies a writeable property on the specified bean; otherwise, returnfalse.static booleanremoveBeanIntrospector(BeanIntrospector introspector)Removes the specifiedBeanIntrospector.static voidresetBeanIntrospectors()Resets the registeredBeanIntrospectorobjects to the initial default state.static voidsetDebug(int newDebug)Deprecated.Thedebugstatic property is no longer usedstatic voidsetIndexedProperty(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 voidsetIndexedProperty(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 voidsetMappedProperty(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 voidsetMappedProperty(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 voidsetNestedProperty(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 voidsetProperty(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 voidsetSimpleProperty(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.
-
-
-
Field Detail
-
INDEXED_DELIM
@Deprecated public static final char INDEXED_DELIM
Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.The delimiter that preceeds the zero-relative subscript for an indexed reference.- See Also:
- Constant Field Values
-
INDEXED_DELIM2
@Deprecated public static final char INDEXED_DELIM2
Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.The delimiter that follows the zero-relative subscript for an indexed reference.- See Also:
- Constant Field Values
-
MAPPED_DELIM
@Deprecated public static final char MAPPED_DELIM
Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.The delimiter that preceeds the key of a mapped property.- See Also:
- Constant Field Values
-
MAPPED_DELIM2
@Deprecated public static final char MAPPED_DELIM2
Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.The delimiter that follows the key of a mapped property.- See Also:
- Constant Field Values
-
NESTED_DELIM
@Deprecated public static final char NESTED_DELIM
Deprecated.The notation used for property name expressions is now dependant on theResolverimplementation being used.The delimiter that separates the components of a nested reference.- See Also:
- Constant Field Values
-
debug
@Deprecated private static int debug
Deprecated.Thedebugstatic property is no longer usedThe debugging detail level for this component. Note that this static variable will have unexpected side-effects if this class is deployed in a shared classloader within a container. However as it is actually completely ignored by this class due to its deprecated status, it doesn't do any actual harm.
-
-
Method Detail
-
addBeanIntrospector
public static void addBeanIntrospector(BeanIntrospector introspector)
Adds aBeanIntrospector. This object is invoked when the property descriptors of a class need to be obtained.- Parameters:
introspector- theBeanIntrospectorto be added (must not be null- Throws:
java.lang.IllegalArgumentException- if the argument is null- Since:
- 1.9
-
clearDescriptors
public static void clearDescriptors()
Clear any cached property descriptors information for all classes loaded by any class loaders. This is useful in cases where class loaders are thrown away to implement class reloading.For more details see
PropertyUtilsBean.- See Also:
PropertyUtilsBean.clearDescriptors()
-
copyProperties
public static void copyProperties(java.lang.Object dest, java.lang.Object orig) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionCopy 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
BeanInfoclasses).For more details see
PropertyUtilsBean.- Parameters:
dest- Destination bean whose properties are modifiedorig- Origin bean whose properties are retrieved- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- if thedestororigargument is nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.copyProperties(java.lang.Object, java.lang.Object)
-
describe
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.NoSuchMethodExceptionReturn the entire set of properties for which the specified bean provides a read method.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose properties are to be extracted- Returns:
- The set of properties for the bean
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.describe(java.lang.Object)
-
getDebug
@Deprecated public static int getDebug()
Deprecated.Thedebugstatic property is no longer usedThedebugstatic property is no longer used- Returns:
- debug property
-
getIndexedProperty
public static java.lang.Object getIndexedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the value of the specified indexed property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be extractedname-propertyname[index]of the property value to be extracted- Returns:
- the indexed property value
- Throws:
java.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- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.getIndexedProperty(Object,String)
-
getIndexedProperty
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.NoSuchMethodExceptionReturn the value of the specified indexed property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 extracted- Returns:
- the indexed property value
- Throws:
java.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- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.getIndexedProperty(Object,String, int)
-
getMappedProperty
public static java.lang.Object getMappedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the value of the specified mapped property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be extractedname-propertyname(key)of the property value to be extracted- Returns:
- the mapped property value
- Throws:
java.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 found- See Also:
PropertyUtilsBean.getMappedProperty(Object,String)
-
getMappedProperty
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.NoSuchMethodExceptionReturn the value of the specified mapped property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 extracted- Returns:
- the mapped property value
- Throws:
java.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 found- See Also:
PropertyUtilsBean.getMappedProperty(Object,String, String)
-
getMappedPropertyDescriptors
@Deprecated public static org.apache.commons.collections.FastHashMap getMappedPropertyDescriptors(java.lang.Class<?> beanClass)
Deprecated.This method should not be exposedReturn the mapped property descriptors for this bean class.
For more details see
PropertyUtilsBean.- Parameters:
beanClass- Bean class to be introspected- Returns:
- the mapped property descriptors
- See Also:
PropertyUtilsBean.getMappedPropertyDescriptors(Class)
-
getMappedPropertyDescriptors
@Deprecated public static org.apache.commons.collections.FastHashMap getMappedPropertyDescriptors(java.lang.Object bean)
Deprecated.This method should not be exposedReturn the mapped property descriptors for this bean.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean to be introspected- Returns:
- the mapped property descriptors
- See Also:
PropertyUtilsBean.getMappedPropertyDescriptors(Object)
-
getNestedProperty
public static java.lang.Object getNestedProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the value of the (possibly nested) property of the specified name, for the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be extractedname- Possibly nested name of the property to be extracted- Returns:
- the nested property value
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.getNestedProperty(java.lang.Object, java.lang.String)
-
getProperty
public static java.lang.Object getProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn 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.- Parameters:
bean- Bean whose property is to be extractedname- Possibly indexed and/or nested name of the property to be extracted- Returns:
- the property value
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.getProperty(java.lang.Object, java.lang.String)
-
getPropertyDescriptor
public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionRetrieve the property descriptor for the specified property of the specified bean, or return
nullif there is no such descriptor.For more details see
PropertyUtilsBean.- Parameters:
bean- Bean for which a property descriptor is requestedname- Possibly indexed and/or nested name of the property for which a property descriptor is requested- Returns:
- the property descriptor
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.getPropertyDescriptor(java.lang.Object, java.lang.String)
-
getPropertyDescriptors
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.- Parameters:
beanClass- Bean class for which property descriptors are requested- Returns:
- the property descriptors
- Throws:
java.lang.IllegalArgumentException- ifbeanClassis null- See Also:
PropertyUtilsBean.getPropertyDescriptors(Class)
-
getPropertyDescriptors
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.- Parameters:
bean- Bean for which property descriptors are requested- Returns:
- the property descriptors
- Throws:
java.lang.IllegalArgumentException- ifbeanis null- See Also:
PropertyUtilsBean.getPropertyDescriptors(Object)
-
getPropertyEditorClass
public static java.lang.Class<?> getPropertyEditorClass(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the Java Class repesenting the property editor class that has been registered for this property (if any).
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean for which a property descriptor is requestedname- Possibly indexed and/or nested name of the property for which a property descriptor is requested- Returns:
- the property editor class
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.getPropertyEditorClass(Object,String)
-
getPropertyType
public static java.lang.Class<?> getPropertyType(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the Java Class representing the property type of the specified property, or
nullif there is no such property for the specified bean.For more details see
PropertyUtilsBean.- Parameters:
bean- Bean for which a property descriptor is requestedname- Possibly indexed and/or nested name of the property for which a property descriptor is requested- Returns:
- The property type
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.getPropertyType(Object, String)
-
getReadMethod
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.- Parameters:
descriptor- Property descriptor to return a getter for- Returns:
- The read method
- See Also:
PropertyUtilsBean.getReadMethod(PropertyDescriptor)
-
getSimpleProperty
public static java.lang.Object getSimpleProperty(java.lang.Object bean, java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturn the value of the specified simple property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be extractedname- Name of the property to be extracted- Returns:
- The property value
- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.getSimpleProperty(java.lang.Object, java.lang.String)
-
getWriteMethod
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.- Parameters:
descriptor- Property descriptor to return a setter for- Returns:
- The write method
- See Also:
PropertyUtilsBean.getWriteMethod(PropertyDescriptor)
-
isReadable
public static boolean isReadable(java.lang.Object bean, java.lang.String name)Return
trueif the specified property name identifies a readable property on the specified bean; otherwise, returnfalse.For more details see
PropertyUtilsBean.- Parameters:
bean- Bean to be examined (may be aDynaBeanname- Property name to be evaluated- Returns:
trueif the property is readable, otherwisefalse- Throws:
java.lang.IllegalArgumentException- ifbeanornameisnull- Since:
- BeanUtils 1.6
- See Also:
PropertyUtilsBean.isReadable(java.lang.Object, java.lang.String)
-
isWriteable
public static boolean isWriteable(java.lang.Object bean, java.lang.String name)Return
trueif the specified property name identifies a writeable property on the specified bean; otherwise, returnfalse.For more details see
PropertyUtilsBean.- Parameters:
bean- Bean to be examined (may be aDynaBeanname- Property name to be evaluated- Returns:
trueif the property is writeable, otherwisefalse- Throws:
java.lang.IllegalArgumentException- ifbeanornameisnull- Since:
- BeanUtils 1.6
- See Also:
PropertyUtilsBean.isWriteable(java.lang.Object, java.lang.String)
-
removeBeanIntrospector
public static boolean removeBeanIntrospector(BeanIntrospector introspector)
Removes the specifiedBeanIntrospector.- Parameters:
introspector- theBeanIntrospectorto be removed- Returns:
- true if the
BeanIntrospectorexisted and could be removed, false otherwise - Since:
- 1.9
-
resetBeanIntrospectors
public static void resetBeanIntrospectors()
Resets the registeredBeanIntrospectorobjects to the initial default state.- Since:
- 1.9
-
setDebug
@Deprecated public static void setDebug(int newDebug)
Deprecated.Thedebugstatic property is no longer usedThedebugstatic property is no longer used- Parameters:
newDebug- debug property
-
setIndexedProperty
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.NoSuchMethodExceptionSets the value of the specified indexed property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 set- Throws:
java.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- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.setIndexedProperty(Object, String, Object)
-
setIndexedProperty
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.NoSuchMethodExceptionSets the value of the specified indexed property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 set- Throws:
java.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- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.setIndexedProperty(Object, String, Object)
-
setMappedProperty
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.NoSuchMethodExceptionSets the value of the specified mapped property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be setname-propertyname(key)of the property value to be setvalue- The property value to be set- Throws:
java.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 found- See Also:
PropertyUtilsBean.setMappedProperty(Object, String, Object)
-
setMappedProperty
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.NoSuchMethodExceptionSets the value of the specified mapped property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 set- Throws:
java.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 found- See Also:
PropertyUtilsBean.setMappedProperty(Object, String, String, Object)
-
setNestedProperty
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.NoSuchMethodExceptionSets the value of the (possibly nested) property of the specified name, for the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
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 set- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.setNestedProperty(java.lang.Object, java.lang.String, java.lang.Object)
-
setProperty
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.NoSuchMethodExceptionSet 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.- Parameters:
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 set- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis nulljava.lang.reflect.InvocationTargetException- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException- if an accessor method for this propety cannot be found- See Also:
PropertyUtilsBean.setProperty(java.lang.Object, java.lang.String, java.lang.Object)
-
setSimpleProperty
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.NoSuchMethodExceptionSet the value of the specified simple property of the specified bean, with no type conversions.
For more details see
PropertyUtilsBean.- Parameters:
bean- Bean whose property is to be modifiedname- Name of the property to be modifiedvalue- Value to which the property should be set- Throws:
java.lang.IllegalAccessException- if the caller does not have access to the property accessor methodjava.lang.IllegalArgumentException- ifbeanornameis 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 found- See Also:
PropertyUtilsBean.setSimpleProperty(java.lang.Object, java.lang.String, java.lang.Object)
-
-