Package org.apache.commons.beanutils
Class ConvertingWrapDynaBean
- java.lang.Object
-
- org.apache.commons.beanutils.WrapDynaBean
-
- org.apache.commons.beanutils.ConvertingWrapDynaBean
-
- All Implemented Interfaces:
java.io.Serializable
,DynaBean
public class ConvertingWrapDynaBean extends WrapDynaBean
Implementation of
DynaBean
that wraps a standard JavaBean instance, so that DynaBean APIs can be used to access its properties, though this implementation allows type conversion to occur when properties are set. This means that (say) Strings can be passed in as values in setter methods and this DynaBean will convert them to the correct primitive data types.IMPLEMENTATION NOTE - This implementation does not support the
contains()
andremove()
methods.- Version:
- $Id: ConvertingWrapDynaBean.java 1747095 2016-06-07 00:27:52Z ggregory $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.commons.beanutils.WrapDynaBean
dynaClass, instance
-
-
Constructor Summary
Constructors Constructor Description ConvertingWrapDynaBean(java.lang.Object instance)
Construct a newDynaBean
associated with the specified JavaBean instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
set(java.lang.String name, java.lang.Object value)
Set the value of the property with the specified name performing any type conversions if necessary.-
Methods inherited from class org.apache.commons.beanutils.WrapDynaBean
contains, get, get, get, getDynaClass, getDynaProperty, getInstance, remove, set, set
-
-
-
-
Method Detail
-
set
public void set(java.lang.String name, java.lang.Object value)
Set the value of the property with the specified name performing any type conversions if necessary. So this method can accept String values for primitive numeric data types for example.- Specified by:
set
in interfaceDynaBean
- Overrides:
set
in classWrapDynaBean
- Parameters:
name
- Name of the property whose value is to be setvalue
- Value to which this property is to be set- Throws:
java.lang.IllegalArgumentException
- if there are any problems copying the property.
-
-