|
|||||||||
| Home >> All >> org >> apache >> commons >> [ beanutils overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.commons.beanutils
Class WrapDynaBean

java.lang.Objectorg.apache.commons.beanutils.WrapDynaBean
- All Implemented Interfaces:
- DynaBean
- Direct Known Subclasses:
- ConvertingWrapDynaBean
- public class WrapDynaBean
- extends java.lang.Object
- implements DynaBean
- extends java.lang.Object
Implementation of DynaBean that wraps a standard JavaBean
instance, so that DynaBean APIs can be used to access its properties.
The most common use cases for this class involve wrapping an existing java bean.
(This makes it different from the typical use cases for other DynaBean's.)
For example:
Object aJavaBean = ...;
...
DynaBean db = new WrapDynaBean(aJavaBean);
...
IMPLEMENTATION NOTE - This implementation does not
support the contains() and remove() methods.
- Version:
- $Revision: 1.9 $ $Date: 2004/02/28 13:18:34 $
| Field Summary | |
protected WrapDynaClass |
dynaClass
The DynaClass "base class" that this DynaBean
is associated with. |
protected java.lang.Object |
instance
The JavaBean instance wrapped by this WrapDynaBean. |
| Constructor Summary | |
WrapDynaBean(java.lang.Object instance)
Construct a new DynaBean associated with the specified
JavaBean instance. |
|
| Method Summary | |
boolean |
contains(java.lang.String name,
java.lang.String key)
Does the specified mapped property contain a value for the specified key value? |
java.lang.Object |
get(java.lang.String name)
Return the value of a simple property with the specified name. |
java.lang.Object |
get(java.lang.String name,
int index)
Return the value of an indexed property with the specified name. |
java.lang.Object |
get(java.lang.String name,
java.lang.String key)
Return the value of a mapped property with the specified name, or null if there is no value for the specified key. |
DynaClass |
getDynaClass()
Return the DynaClass instance that describes the set of
properties available for this DynaBean. |
protected DynaProperty |
getDynaProperty(java.lang.String name)
Return the property descriptor for the specified property name. |
java.lang.Object |
getInstance()
Gets the bean instance wrapped by this DynaBean. |
void |
remove(java.lang.String name,
java.lang.String key)
Remove any existing value for the specified key on the specified mapped property. |
void |
set(java.lang.String name,
int index,
java.lang.Object value)
Set the value of an indexed property with the specified name. |
void |
set(java.lang.String name,
java.lang.Object value)
Set the value of a simple property with the specified name. |
void |
set(java.lang.String name,
java.lang.String key,
java.lang.Object value)
Set the value of a mapped property with the specified name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
dynaClass
protected WrapDynaClass dynaClass
- The
DynaClass"base class" that this DynaBean is associated with.
instance
protected java.lang.Object instance
- The JavaBean instance wrapped by this WrapDynaBean.
| Constructor Detail |
WrapDynaBean
public WrapDynaBean(java.lang.Object instance)
- Construct a new
DynaBeanassociated with the specified JavaBean instance.
| Method Detail |
contains
public boolean contains(java.lang.String name, java.lang.String key)
- Does the specified mapped property contain a value for the specified
key value?
get
public java.lang.Object get(java.lang.String name)
- Return the value of a simple property with the specified name.
get
public java.lang.Object get(java.lang.String name, int index)
- Return the value of an indexed property with the specified name.
get
public java.lang.Object get(java.lang.String name, java.lang.String key)
- Return the value of a mapped property with the specified name,
or
nullif there is no value for the specified key.
getDynaClass
public DynaClass getDynaClass()
- Return the
DynaClassinstance that describes the set of properties available for this DynaBean.- Specified by:
getDynaClassin interfaceDynaBean
remove
public void remove(java.lang.String name, java.lang.String key)
- Remove any existing value for the specified key on the
specified mapped property.
set
public void set(java.lang.String name, java.lang.Object value)
set
public void set(java.lang.String name, int index, java.lang.Object value)
- Set the value of an indexed property with the specified name.
set
public void set(java.lang.String name, java.lang.String key, java.lang.Object value)
getInstance
public java.lang.Object getInstance()
- Gets the bean instance wrapped by this DynaBean.
For most common use cases,
this object should already be known
and this method safely be ignored.
But some creators of frameworks using
DynaBean's may find this useful.
getDynaProperty
protected DynaProperty getDynaProperty(java.lang.String name)
- Return the property descriptor for the specified property name.
|
|||||||||
| Home >> All >> org >> apache >> commons >> [ beanutils overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.commons.beanutils.WrapDynaBean