|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataObject
Defines an object that provides unified access to its state via property accessors. The significant state of a data object may be accessed entirely via its getValue () and setValue () methods.
Data objects also provide unified notification of property changes to
themselves and their child data objects. Property events from child objects
percolate down to listeners of the parent. These changes to the object tree
may be monitored via the PropertyListener
interface, which uses PropertyPath
to define the
path to values in the tree.
Properties of data objects can be explicitly marked as transient: see
isTransient(Object)
.
IDataBean
,
DataObjects
,
PropertyListener
Field Summary | |
---|---|
static int |
OVERRIDE
|
static int |
PERSISTENT
|
static int |
PERSISTENT_OVERRIDE
|
static int |
TRANSIENT
|
static int |
TRANSIENT_OVERRIDE
|
Method Summary | |
---|---|
void |
addPropertyListener(PropertyListener l)
Add a listener that will be notified when changes to the properties on this or child objects are made. |
Collection |
getPropertyListeners()
Return a non-modifiable list of registered property listeners. |
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<Object> |
propertyIterator()
Get an iterator that scans over all currently defined properties. |
void |
removePropertyListener(PropertyListener l)
Reverse the effect of addPropertyListener(PropertyListener) . |
void |
setValue(Object name,
Object value)
Set the value of a given property. |
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. |
Field Detail |
---|
static final int PERSISTENT
static final int TRANSIENT
static final int OVERRIDE
static final int TRANSIENT_OVERRIDE
static final int PERSISTENT_OVERRIDE
Method Detail |
---|
TypeInfo getTypeInfo()
TypeRegistry
void setValue(Object name, Object value)
setValue (name, value, PERSISTENT_OVERRIDE)
name
- The property "name" (may be any object).value
- The property value.setValue(Object, Object, int)
,
getValue(Object)
,
PropertyListener
,
PropertyEvent
void setValue(Object name, Object value, int mode)
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).setValue(Object, Object)
Object getValue(Object name)
name
- The property "name" (may be any object).
setValue(Object, Object)
,
propertyIterator()
boolean isTransient(Object name)
name
- The property name.
Iterator<Object> propertyIterator()
getValue(Object)
).getValue(Object)
,
PropertyValueIterator
IDataObject shallowClone() throws UnsupportedOperationException
NOTE: Clients should not need to call this method:
use DataObjects.deepClone(IDataObject)
instead.
UnsupportedOperationException
- if the object or child object could not
be cloned.DataObjects.deepClone(IDataObject)
void addPropertyListener(PropertyListener l)
removePropertyListener(PropertyListener)
,
getPropertyListeners()
void removePropertyListener(PropertyListener l)
addPropertyListener(PropertyListener)
.
Collection getPropertyListeners()
addPropertyListener(PropertyListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |