|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.databeans.AbstractDataObject
dsto.dfc.databeans.AbstractDataBean
dsto.dfc.databeans.DataBean
public class DataBean
Default implementation of IDataBean using Java collections classes for storage.
Field Summary | |
---|---|
protected Set |
alwaysTransient
|
protected HashSet |
transientProperties
|
protected TypeInfo |
typeInfo
|
protected HashMap |
values
|
Fields inherited from class dsto.dfc.databeans.AbstractDataObject |
---|
listeners |
Fields inherited from interface dsto.dfc.databeans.IDataObject |
---|
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE |
Constructor Summary | |
---|---|
DataBean()
|
|
DataBean(Dictionary dictionary)
Create an instance copied from a java.util.Dictionary. |
|
DataBean(Map map)
Create a databean initialised from the contents of a java.util.Map. |
|
DataBean(TypeInfo type)
Create an instance with a specified type. |
Method Summary | |
---|---|
void |
childPropertyChanged(Object childProperty,
PropertyEvent e)
Invoked when a child property value has changed. |
String[] |
getPropertyNames()
Databean's only have strings as their property names. |
TypeInfo |
getTypeInfo()
Get the optional type information for this object. |
Object |
getValue(Object name)
Get the value of a given property. |
boolean |
isTransient(Object name)
Test a property is transient (ie will not be preserved if the object is saved). |
Iterator |
propertyIterator()
Get an iterator that scans over all currently defined properties. |
void |
setAlwaysTransient(String name)
Flag a property as always transient regardless of any changes that would normally make it non-transient. |
void |
setTypeInfo(TypeInfo typeInfo)
|
void |
setValue(Object name,
Object value,
int mode)
Set the value of a given property. |
IDataObject |
shallowClone()
Shallow clone the object prior to being recusively "deep" cloned. |
Methods inherited from class dsto.dfc.databeans.AbstractDataBean |
---|
setValue, setValue, setValue, setValue, setValue, setValue, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dsto.dfc.databeans.IDataBean |
---|
getBeanValue, getBooleanValue, getCharValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getObjectValue, getStringValue, setValue, setValue, setValue, setValue, setValue, setValue |
Methods inherited from interface dsto.dfc.databeans.IDataObject |
---|
addPropertyListener, getPropertyListeners, removePropertyListener, setValue |
Field Detail |
---|
protected HashMap values
protected HashSet transientProperties
protected Set alwaysTransient
protected TypeInfo typeInfo
Constructor Detail |
---|
public DataBean()
public DataBean(Map map)
public DataBean(Dictionary dictionary)
public DataBean(TypeInfo type)
Method Detail |
---|
public TypeInfo getTypeInfo()
IDataObject
getTypeInfo
in interface IDataObject
getTypeInfo
in class AbstractDataObject
TypeRegistry
public void setTypeInfo(TypeInfo typeInfo)
public void setAlwaysTransient(String name)
public IDataObject shallowClone() throws UnsupportedOperationException
IDataObject
NOTE: Clients should not need to call this method:
use DataObjects.deepClone(IDataObject)
instead.
shallowClone
in interface IDataObject
shallowClone
in class AbstractDataObject
UnsupportedOperationException
- if the object or child object could not
be cloned.DataObjects.deepClone(IDataObject)
public Object getValue(Object name)
IDataObject
name
- The property "name" (may be any object).
IDataObject.setValue(Object, Object)
,
IDataObject.propertyIterator()
public void setValue(Object name, Object value, int mode)
IDataObject
setValue
in interface IDataObject
setValue
in class AbstractDataObject
name
- A property name.value
- The new value. On most objects using null removes
the property.mode
- The mode for the value. This is a bitwise OR of
TRANSIENT and/or OVERRIDE. Using TRANSIENT specifies the
value is to be marked transient (ie isTransient (name)
will return true). Not all data object implementations
support dynamic transience. OVERRIDE must be set if an
existing value is to be overwritten: if not set and a
value is already defined, then nothing is changed. The
IDataObject.setValue (name, value) call corresponds to
IDataBean.setValue (name, value, OVERRIDE).IDataObject.setValue(Object, Object)
public boolean isTransient(Object name)
IDataObject
name
- The property name.
public Iterator propertyIterator()
IDataObject
IDataObject.getValue(Object)
).IDataObject.getValue(Object)
,
PropertyValueIterator
public String[] getPropertyNames()
IDataBean
public void childPropertyChanged(Object childProperty, PropertyEvent e)
AbstractDataObject
childPropertyChanged
in interface IDataObjectChildListener
childPropertyChanged
in class AbstractDataObject
childProperty
- The property name on this object that the child
is accessible by.e
- The change event from the child.AbstractDataObject.registerValue(Object, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |