|
||||||||||
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.DataObject
public class DataObject
A default implemention of IDataObject based on a java.util.Map. This may be used as is or extended.
Field Summary | |
---|---|
protected Map<Object,Object> |
propertyToValue
Maps from property names to values. |
protected TypeInfo |
typeInfo
|
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 | |
---|---|
DataObject()
|
|
DataObject(TypeInfo type)
Create an instance with a specified type. |
Method Summary | |
---|---|
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 |
iterator()
Create an iterator over all the values in the object. |
Iterator |
propertyIterator()
Get an iterator that scans over all currently defined properties. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Map<Object,Object> propertyToValue
protected TypeInfo typeInfo
Constructor Detail |
---|
public DataObject()
public DataObject(TypeInfo type)
Method Detail |
---|
public IDataObject shallowClone()
IDataObject
NOTE: Clients should not need to call this method:
use DataObjects.deepClone(IDataObject)
instead.
shallowClone
in interface IDataObject
shallowClone
in class AbstractDataObject
DataObjects.deepClone(IDataObject)
public Iterator iterator()
public Iterator propertyIterator()
IDataObject
propertyIterator
in interface IDataObject
IDataObject.getValue(Object)
).IDataObject.getValue(Object)
,
PropertyValueIterator
public TypeInfo getTypeInfo()
IDataObject
getTypeInfo
in interface IDataObject
getTypeInfo
in class AbstractDataObject
TypeRegistry
public void setTypeInfo(TypeInfo typeInfo)
public Object getValue(Object name)
IDataObject
getValue
in interface 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
isTransient
in interface IDataObject
name
- The property name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |