|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.collections.BasicMonitoredCollection dsto.dfc.collections.BasicMonitoredSet dsto.dfc.databeans.SetDataObject
public class SetDataObject
An extension of the DFC monitored set that supports access via the IDataObject interface. Any IDataObject's in the set are automatically monitored and the appropriate property events fired. The property values of the set are the values themselves.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class dsto.dfc.collections.BasicMonitoredCollection |
---|
BasicMonitoredCollection.CollectionIteratorWrapper |
Field Summary | |
---|---|
protected HashSet |
transientProperties
|
Fields inherited from class dsto.dfc.collections.BasicMonitoredCollection |
---|
collection, collectionListeners |
Fields inherited from interface dsto.dfc.databeans.IDataObject |
---|
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE |
Constructor Summary | |
---|---|
SetDataObject()
|
|
SetDataObject(Set set)
|
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 source,
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 |
registerValue(Object value)
|
void |
removePropertyListener(PropertyListener l)
Reverse the effect of IDataObject.addPropertyListener(PropertyListener) . |
void |
setValue(Object name,
Object value)
This is a little weird for sets, where nominally name and value must be the same. |
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 |
unregisterValue(Object value)
|
Methods inherited from class dsto.dfc.collections.BasicMonitoredCollection |
---|
add, addAll, addCollectionListener, clear, clone, contains, containsAll, emptyClone, fireElementsAdded, fireElementsRemoved, isEmpty, iterator, remove, removeAll, removeCollectionListener, retainAll, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dsto.dfc.collections.MonitoredCollection |
---|
addCollectionListener, removeCollectionListener |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Field Detail |
---|
protected HashSet transientProperties
Constructor Detail |
---|
public SetDataObject()
public SetDataObject(Set set)
Method Detail |
---|
public TypeInfo getTypeInfo()
IDataObject
getTypeInfo
in interface IDataObject
TypeRegistry
public Collection getPropertyListeners()
IDataObject
getPropertyListeners
in interface IDataObject
IDataObject.addPropertyListener(PropertyListener)
protected void registerValue(Object value)
protected void unregisterValue(Object value)
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)
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 source, 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 |