Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.beanutils
Class BasicDynaBean  view BasicDynaBean download BasicDynaBean.java

java.lang.Object
  extended byorg.apache.commons.beanutils.BasicDynaBean
All Implemented Interfaces:
DynaBean, java.io.Serializable

public class BasicDynaBean
extends java.lang.Object
implements DynaBean, java.io.Serializable

Minimal implementation of the DynaBean interface. Can be used as a convenience base class for more sophisticated implementations.

IMPLEMENTATION NOTE - Instances of this class that are accessed from multiple threads simultaneously need to be synchronized.

IMPLEMENTATION NOTE - Instances of this class can be successfully serialized and deserialized ONLY if all property values are Serializable.

Version:
$Revision: 1.11 $ $Date: 2004/02/28 13:18:33 $

Field Summary
protected  DynaClass dynaClass
          The DynaClass "base class" that this DynaBean is associated with.
protected  java.util.HashMap values
          The set of property values for this DynaBean, keyed by property name.
 
Constructor Summary
BasicDynaBean(DynaClass dynaClass)
          Construct a new DynaBean associated with the specified DynaClass 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.
protected  boolean isAssignable(java.lang.Class dest, java.lang.Class source)
          Is an object of the source class assignable to the destination class?
 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 DynaClass dynaClass
The DynaClass "base class" that this DynaBean is associated with.


values

protected java.util.HashMap values
The set of property values for this DynaBean, keyed by property name.

Constructor Detail

BasicDynaBean

public BasicDynaBean(DynaClass dynaClass)
Construct a new DynaBean associated with the specified DynaClass 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?

Specified by:
contains in interface DynaBean

get

public java.lang.Object get(java.lang.String name)
Return the value of a simple property with the specified name.

Specified by:
get in interface DynaBean

get

public java.lang.Object get(java.lang.String name,
                            int index)
Return the value of an indexed property with the specified name.

Specified by:
get in interface DynaBean

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 null if there is no value for the specified key.

Specified by:
get in interface DynaBean

getDynaClass

public DynaClass getDynaClass()
Return the DynaClass instance that describes the set of properties available for this DynaBean.

Specified by:
getDynaClass in interface DynaBean

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.

Specified by:
remove in interface DynaBean

set

public void set(java.lang.String name,
                java.lang.Object value)
Set the value of a simple property with the specified name.

Specified by:
set in interface DynaBean

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.

Specified by:
set in interface DynaBean

set

public 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.

Specified by:
set in interface DynaBean

getDynaProperty

protected DynaProperty getDynaProperty(java.lang.String name)
Return the property descriptor for the specified property name.


isAssignable

protected boolean isAssignable(java.lang.Class dest,
                               java.lang.Class source)
Is an object of the source class assignable to the destination class?