|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.collections.BasicMonitoredCollection
dsto.dfc.collections.BasicMonitoredList
dsto.dfc.collections.DfcMonitoredList
dsto.dfc.databeans.ListDataObject
public class ListDataObject
An extension of the DFC monitored list that supports access via the IDataObject interface. Any IDataObject's in the list are automatically monitored and the appropriate property events fired.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class dsto.dfc.collections.BasicMonitoredList |
---|
BasicMonitoredList.ListIteratorWrapper |
Nested classes/interfaces inherited from class dsto.dfc.collections.BasicMonitoredCollection |
---|
BasicMonitoredCollection.CollectionIteratorWrapper |
Field Summary |
---|
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 | |
---|---|
ListDataObject()
|
|
ListDataObject(List list)
|
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. |
Object |
clone()
Create a completely separate copy of this object and any mutable objects owned by the object. |
void |
elementMoved(CollectionEvent e)
Fired when an element in the list has moved (changed indexes). |
void |
elementsAdded(CollectionEvent e)
|
void |
elementsRemoved(CollectionEvent e)
|
protected void |
firePropertyChangedEvent(int index,
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). |
protected int |
nameToIndex(Object name)
Translate a property name into an index into the list. |
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) . |
Object |
set(int index,
Object newValue)
Override set () to generate a single property change event rather than two (old -> null, null -> new). |
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 |
unregisterValue(Object value)
|
Methods inherited from class dsto.dfc.collections.DfcMonitoredList |
---|
addDfcMonitoredListListener, fireElementMoved, move, removeDfcMonitoredListListener |
Methods inherited from class dsto.dfc.collections.BasicMonitoredList |
---|
add, add, addAll, addAll, clear, get, getBackingList, indexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, subList |
Methods inherited from class dsto.dfc.collections.BasicMonitoredCollection |
---|
addCollectionListener, contains, containsAll, emptyClone, fireElementsAdded, fireElementsRemoved, isEmpty, iterator, 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.List |
---|
contains, containsAll, equals, hashCode, isEmpty, iterator, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public ListDataObject()
public ListDataObject(List list)
Method Detail |
---|
public Object clone() throws CloneNotSupportedException
Copyable
NOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.
clone
in interface Copyable
clone
in class BasicMonitoredCollection
CloneNotSupportedException
- if the clone failed or is not
possible.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)
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.
protected int nameToIndex(Object name) throws NumberFormatException
name
- The property name.
NumberFormatException
- if name is neither an Integer or a
string that parses with
Integer.parseInt(java.lang.String)
.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 Object set(int index, Object newValue)
set
in interface List
set
in class BasicMonitoredList
public void elementsAdded(CollectionEvent e)
elementsAdded
in interface CollectionListener
public void elementsRemoved(CollectionEvent e)
elementsRemoved
in interface CollectionListener
public void elementMoved(CollectionEvent e)
DfcMonitoredListListener
elementMoved
in interface DfcMonitoredListListener
e
- The move event. startIndex is the element's old index,
endIndex is the new index.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(int index, 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 |