|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.collections.BasicCollectionEventSource
dsto.dfc.collections.BasicMonitoredMap
dsto.dfc.databeans.MapDataObject
public class MapDataObject
An extension of the DFC monitored map that supports access via the IDataObject interface. Any IDataObject values in the map are automatically monitored and the appropriate property events fired.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class dsto.dfc.collections.BasicMonitoredMap |
---|
BasicMonitoredMap.MyEntry |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected HashSet |
transientProperties
|
Fields inherited from class dsto.dfc.collections.BasicMonitoredMap |
---|
backingMap |
Fields inherited from interface dsto.dfc.databeans.IDataObject |
---|
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE |
Constructor Summary | |
---|---|
MapDataObject()
|
|
MapDataObject(Map map)
|
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. |
void |
childPropertyChanged(Object childProperty,
PropertyEvent e)
Called when a child data object's property changes. |
void |
elementsAdded(CollectionEvent e)
|
void |
elementsRemoved(CollectionEvent e)
|
protected void |
firePropertyChangedEvent(Object property,
Object oldValue,
Object newValue,
boolean transientProperty)
|
protected void |
firePropertyChangedEvent(Object property,
PropertyPath basePath,
Object oldValue,
Object newValue,
boolean transientProperty)
|
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 |
propertyIterator()
Get an iterator that scans over all currently defined properties. |
protected void |
register(Map.Entry entry)
|
void |
removePropertyListener(PropertyListener l)
Reverse the effect of IDataObject.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. |
protected void |
unregister(Map.Entry entry)
|
Methods inherited from class dsto.dfc.collections.BasicMonitoredMap |
---|
clear, clone, containsKey, containsValue, emptyClone, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class dsto.dfc.collections.BasicCollectionEventSource |
---|
addCollectionListener, fireElementAdded, fireElementAdded, fireElementRemoved, fireElementRemoved, fireElementsAdded, fireElementsAdded, fireElementsAdded, fireElementsRemoved, fireElementsRemoved, fireElementsRemoved, removeCollectionListener |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface dsto.dfc.collections.MonitoredMap |
---|
addCollectionListener, removeCollectionListener |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected HashSet transientProperties
Constructor Detail |
---|
public MapDataObject()
public MapDataObject(Map map)
Method Detail |
---|
public TypeInfo getTypeInfo()
IDataObject
getTypeInfo
in interface IDataObject
TypeRegistry
public Collection getPropertyListeners()
IDataObject
getPropertyListeners
in interface IDataObject
IDataObject.addPropertyListener(PropertyListener)
protected void register(Map.Entry entry)
protected void unregister(Map.Entry entry)
public IDataObject shallowClone() throws UnsupportedOperationException
IDataObject
NOTE: Clients should not need to call this method:
use DataObjects.deepClone(IDataObject)
instead.
shallowClone
in interface IDataObject
UnsupportedOperationException
- if the object or child object could not
be cloned.DataObjects.deepClone(IDataObject)
public void setValue(Object name, Object value)
IDataObject
setValue (name, value, PERSISTENT_OVERRIDE)
setValue
in interface IDataObject
name
- The property "name" (may be any object).value
- The property value.IDataObject.setValue(Object, Object, int)
,
IDataObject.getValue(Object)
,
PropertyListener
,
PropertyEvent
public void setValue(Object name, Object value, int mode)
IDataObject
setValue
in interface IDataObject
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 Object getValue(Object name)
IDataObject
getValue
in interface IDataObject
name
- The property "name" (may be any object).
IDataObject.setValue(Object, Object)
,
IDataObject.propertyIterator()
public boolean isTransient(Object name)
IDataObject
isTransient
in interface IDataObject
name
- The property name.
public Iterator propertyIterator()
IDataObject
propertyIterator
in interface IDataObject
IDataObject.getValue(Object)
).IDataObject.getValue(Object)
,
PropertyValueIterator
public void addPropertyListener(PropertyListener l)
IDataObject
addPropertyListener
in interface IDataObject
IDataObject.removePropertyListener(PropertyListener)
,
IDataObject.getPropertyListeners()
public void removePropertyListener(PropertyListener l)
IDataObject
IDataObject.addPropertyListener(PropertyListener)
.
removePropertyListener
in interface IDataObject
public void elementsAdded(CollectionEvent e)
elementsAdded
in interface CollectionListener
public void elementsRemoved(CollectionEvent e)
elementsRemoved
in interface CollectionListener
public void childPropertyChanged(Object childProperty, PropertyEvent e)
IDataObjectChildListener
childPropertyChanged
in interface IDataObjectChildListener
childProperty
- The property the child is registered under.e
- The property change event emitted by the child.protected void firePropertyChangedEvent(Object property, Object oldValue, Object newValue, boolean transientProperty)
protected void firePropertyChangedEvent(Object property, PropertyPath basePath, Object oldValue, Object newValue, boolean transientProperty)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |