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()
and remove()
methods.
dynaClass, instance
Constructor and Description |
---|
ConvertingWrapDynaBean(Object instance)
Construct a new
DynaBean associated with the specified
JavaBean instance. |
Modifier and Type | Method and Description |
---|---|
void |
set(String name,
Object value)
Set the value of the property with the specified name
performing any type conversions if necessary.
|
contains, get, get, get, getDynaClass, getDynaProperty, getInstance, remove, set, set
public ConvertingWrapDynaBean(Object instance)
DynaBean
associated with the specified
JavaBean instance.instance
- JavaBean instance to be wrappedpublic void set(String name, Object value)
set
in interface DynaBean
set
in class WrapDynaBean
name
- Name of the property whose value is to be setvalue
- Value to which this property is to be setIllegalArgumentException
- if there are any problems
copying the property.Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.