|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.databeans.AbstractDataObject dsto.dfc.databeans.SimpleDataObject dsto.dfc.databeans.FancyDataObject
public class FancyDataObject
Extends SimpleDataObject to allow properties to be added dynamically to the fixed base set supported by the class. If a property that is not a field of the object is set, then the property is added dynamically.
Note: this class has been designed add little extra cost for normal property accesses, so it can be cheaply used in place of SimpleDataObject wherever extended properties might be needed, even if they're not currently required.
Field Summary |
---|
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 | |
---|---|
FancyDataObject()
|
Method Summary | |
---|---|
void |
childPropertyChanged(Object childProperty,
PropertyEvent e)
Invoked when a child property value has changed. |
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 |
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.SimpleDataObject |
---|
getFieldNames, getTypeInfo, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FancyDataObject()
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 Object getValue(Object name)
IDataObject
getValue
in interface IDataObject
getValue
in class SimpleDataObject
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 SimpleDataObject
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 Iterator propertyIterator()
IDataObject
propertyIterator
in interface IDataObject
propertyIterator
in class SimpleDataObject
IDataObject.getValue(Object)
).IDataObject.getValue(Object)
,
PropertyValueIterator
public boolean isTransient(Object name)
IDataObject
isTransient
in interface IDataObject
isTransient
in class SimpleDataObject
name
- The property name.
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 | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |