dsto.dfc.databeans
Interface IDataObject

All Known Subinterfaces:
IDataBean, IDataObjectChildListener
All Known Implementing Classes:
AbstractDataBean, AbstractDataObject, AbstractPropertyFilterSet, AbstractProtocol, Amplifier, AudioMixerEntity, CallEntity, CameraEntity, ClipboardEntity, ComputerEntity, DataBean, DataBeanLink, DataBeanWeakRef, DataObject, DataObjectLink, DataObjectView, DataObjectWeakRef, DirectoryEntryEntity, DisplayEntity, DocumentEntity, DocumentLibraryEntity, Entity, EntityList, EntityList.ListEntity, EntityQueue, EntityRegistry, EntityStack, EventCategory, FancyDataObject, GenericEntity, InfoRepositoryEntity, JavaDataBean, LightEntity, Link, ListDataObject, LogEntry, MapDataObject, MediaView, MetaApp, MetaAppElement, MetaAppElementGroup, MetaApps, MultiValuePropertyFilterSet, PictureEntity, PictureProgramEntity, PictureProgramLayoutEntity, PictureProgramWindowEntity, PositionableDevice, PresenceEntity, PropertyFilter, PropertyFilterSet, QueryEntity, Registry, RoomEntity, RoomPresentation, RoomSchematicEntity, SchematicItem, ScreenConnection, ScreenSharing, SessionEntity, Sessions, SetDataObject, SimpleDataObject, SimpleJavaDataBean, SpeakerEntity, StackDataObject, SubsetDataObject, SupersetDataObject, Teamscope, TeamscopeProject, TeamscopeSession, TeamthinkEntity, Trash, TypeInfo, VideoInputEntity, VideoOutputEntity, VideoSourceEntity, VirtualMonitorEntity, VTCEntity

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).

Version:
$Revision$
Author:
mpp
See Also:
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

PERSISTENT

static final int PERSISTENT
See Also:
Constant Field Values

TRANSIENT

static final int TRANSIENT
See Also:
Constant Field Values

OVERRIDE

static final int OVERRIDE
See Also:
Constant Field Values

TRANSIENT_OVERRIDE

static final int TRANSIENT_OVERRIDE
See Also:
Constant Field Values

PERSISTENT_OVERRIDE

static final int PERSISTENT_OVERRIDE
See Also:
Constant Field Values
Method Detail

getTypeInfo

TypeInfo getTypeInfo()
Get the optional type information for this object. If the object has none, this will be null.

See Also:
TypeRegistry

setValue

void setValue(Object name,
              Object value)
Set the value of a given property. If the object supports it, a property change event should be emitted. This is usually a synonym for setValue (name, value, PERSISTENT_OVERRIDE)

Parameters:
name - The property "name" (may be any object).
value - The property value.
See Also:
setValue(Object, Object, int), getValue(Object), PropertyListener, PropertyEvent

setValue

void setValue(Object name,
              Object value,
              int mode)
Set the value of a given property. If the object supports it, a property change event should be emitted.

Parameters:
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).
See Also:
setValue(Object, Object)

getValue

Object getValue(Object name)
Get the value of a given property.

Parameters:
name - The property "name" (may be any object).
Returns:
the value of a given property or null if the property is not defined.
See Also:
setValue(Object, Object), propertyIterator()

isTransient

boolean isTransient(Object name)
Test a property is transient (ie will not be preserved if the object is saved).

Parameters:
name - The property name.
Returns:
boolean True if the property is transient.

propertyIterator

Iterator<Object> propertyIterator()
Get an iterator that scans over all currently defined properties.

Returns:
An iterator that yields all defined property values (ie that would get a non-null result from getValue(Object)).
See Also:
getValue(Object), PropertyValueIterator

shallowClone

IDataObject shallowClone()
                         throws UnsupportedOperationException
Shallow clone the object prior to being recusively "deep" cloned. This should return a new instance of the same class as the object suitable for receiving a series of setValue () calls to add copied properties from the original. Only state that would not be copied by the copying of all properties needs to be cloned by this method.

NOTE: Clients should not need to call this method: use DataObjects.deepClone(IDataObject) instead.

Returns:
A new object of the same type, with the same values as the original.
Throws:
UnsupportedOperationException - if the object or child object could not be cloned.
See Also:
DataObjects.deepClone(IDataObject)

addPropertyListener

void addPropertyListener(PropertyListener l)
Add a listener that will be notified when changes to the properties on this or child objects are made.

See Also:
removePropertyListener(PropertyListener), getPropertyListeners()

removePropertyListener

void removePropertyListener(PropertyListener l)
Reverse the effect of addPropertyListener(PropertyListener).


getPropertyListeners

Collection getPropertyListeners()
Return a non-modifiable list of registered property listeners.

See Also:
addPropertyListener(PropertyListener)


Copyright © 2008 Commonwealth of Australia