|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.databeans.AbstractDataObject
public abstract class AbstractDataObject
Abstract base class for IDataObject's. Provides event listener support and support for listening to child objects and re-firing property changes.
NOTE: this class implements java.lang.Cloneable only in order to be
able to invoke clone () internally - the clone () method is left
protected. Use
DataObjects.deepClone(IDataObject)
to
clone a tree of objects.
Field Summary | |
---|---|
protected EventListenerList |
listeners
|
Fields inherited from interface dsto.dfc.databeans.IDataObject |
---|
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE |
Constructor Summary | |
---|---|
AbstractDataObject()
|
Method Summary | |
---|---|
void |
addFirstPropertyListener(PropertyListener l)
Add listener to the front of the list, so it will get events before all other current listeners. |
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)
Invoked when a child property value has changed. |
void |
firePropertyChangedEvent(Object property,
boolean newValue,
boolean isTransient)
Shortcut to fire property changed event when a boolean value has definitely changed. |
void |
firePropertyChangedEvent(Object property,
boolean oldValue,
boolean newValue,
boolean isTransient)
|
void |
firePropertyChangedEvent(Object property,
int oldValue,
int newValue,
boolean isTransient)
|
void |
firePropertyChangedEvent(Object property,
Object oldValue,
Object newValue,
boolean isTransient)
|
void |
firePropertyChangedEvent(Object property,
PropertyPath basePath,
Object oldValue,
Object newValue,
boolean isTransient)
|
void |
firePropertyChangedEvent(PropertyPath path,
Object oldValue,
Object newValue,
boolean isTransient)
|
IDataBean |
getBeanValue(String name)
|
boolean |
getBooleanValue(Object name)
|
boolean |
getBooleanValue(String name)
|
char |
getCharValue(Object name)
|
char |
getCharValue(String name)
|
double |
getDoubleValue(Object name)
|
double |
getDoubleValue(String name)
|
float |
getFloatValue(Object name)
|
float |
getFloatValue(String name)
|
int |
getIntValue(Object name)
|
int |
getIntValue(String name)
|
long |
getLongValue(Object name)
|
long |
getLongValue(String name)
|
IDataObject |
getObjectValue(String name)
|
Collection |
getPropertyListeners()
Return a non-modifiable list of registered property listeners. |
short |
getShortValue(String name)
|
String |
getStringValue(String name)
|
abstract TypeInfo |
getTypeInfo()
Get the optional type information for this object. |
protected void |
registerValue(Object property,
Object value)
Register a child value of this object. |
void |
removePropertyListener(PropertyListener l)
Reverse the effect of IDataObject.addPropertyListener(PropertyListener) . |
void |
setValue(Object name,
boolean value)
|
void |
setValue(Object name,
char value)
|
void |
setValue(Object name,
double value)
|
void |
setValue(Object name,
float value)
|
void |
setValue(Object name,
int value)
|
void |
setValue(Object name,
long value)
|
void |
setValue(Object name,
Object value)
Synonym for setValue (name, value, PERSISTENT_OVERRIDE). |
abstract void |
setValue(Object name,
Object value,
int mode)
Set the value of a given property. |
void |
setValue(String name,
boolean value)
|
void |
setValue(String name,
char value)
|
void |
setValue(String name,
double value)
|
void |
setValue(String name,
float value)
|
void |
setValue(String name,
int value)
|
void |
setValue(String name,
long value)
|
void |
setValue(String name,
short value)
|
IDataObject |
shallowClone()
Shallow clone the object prior to being recusively "deep" cloned. |
String |
toString()
Generates a human-readable rendering of the object's properties. |
protected void |
unregisterValue(Object value)
Undo the effect of registerValue(Object, Object) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dsto.dfc.databeans.IDataObject |
---|
getValue, isTransient, propertyIterator |
Field Detail |
---|
protected EventListenerList listeners
Constructor Detail |
---|
public AbstractDataObject()
Method Detail |
---|
public IDataObject shallowClone()
IDataObject
NOTE: Clients should not need to call this method:
use DataObjects.deepClone(IDataObject)
instead.
shallowClone
in interface IDataObject
DataObjects.deepClone(IDataObject)
public abstract TypeInfo getTypeInfo()
IDataObject
getTypeInfo
in interface IDataObject
TypeRegistry
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 abstract 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 void setValue(Object name, boolean value)
public boolean getBooleanValue(Object name)
public void setValue(Object name, int value)
public int getIntValue(Object name)
public void setValue(Object name, long value)
public long getLongValue(Object name)
public void setValue(Object name, float value)
public float getFloatValue(Object name)
public void setValue(Object name, double value)
public double getDoubleValue(Object name)
public void setValue(Object name, char value)
public char getCharValue(Object name)
public void setValue(String name, boolean value)
public boolean getBooleanValue(String name)
public void setValue(String name, short value)
public short getShortValue(String name)
public void setValue(String name, int value)
public int getIntValue(String name)
public void setValue(String name, long value)
public long getLongValue(String name)
public void setValue(String name, float value)
public float getFloatValue(String name)
public void setValue(String name, double value)
public double getDoubleValue(String name)
public void setValue(String name, char value)
public char getCharValue(String name)
public IDataBean getBeanValue(String name)
public IDataObject getObjectValue(String name)
public void addPropertyListener(PropertyListener l)
IDataObject
addPropertyListener
in interface IDataObject
IDataObject.removePropertyListener(PropertyListener)
,
IDataObject.getPropertyListeners()
public void addFirstPropertyListener(PropertyListener l)
public void removePropertyListener(PropertyListener l)
IDataObject
IDataObject.addPropertyListener(PropertyListener)
.
removePropertyListener
in interface IDataObject
public Collection getPropertyListeners()
IDataObject
getPropertyListeners
in interface IDataObject
IDataObject.addPropertyListener(PropertyListener)
protected void registerValue(Object property, Object value)
childPropertyChanged(Object, PropertyEvent)
called whenever
it changes.
property
- The name of the child.value
- The child value.DataObjects.registerChildValue(IDataObjectChildListener, Object, Object)
,
unregisterValue(Object)
protected void unregisterValue(Object value)
registerValue(Object, Object)
.
DataObjects.unregisterChildValue(IDataObjectChildListener, Object)
public void childPropertyChanged(Object childProperty, PropertyEvent e)
childPropertyChanged
in interface IDataObjectChildListener
childProperty
- The property name on this object that the child
is accessible by.e
- The change event from the child.registerValue(Object, Object)
public void firePropertyChangedEvent(Object property, PropertyPath basePath, Object oldValue, Object newValue, boolean isTransient)
public void firePropertyChangedEvent(Object property, Object oldValue, Object newValue, boolean isTransient)
public void firePropertyChangedEvent(PropertyPath path, Object oldValue, Object newValue, boolean isTransient)
public void firePropertyChangedEvent(Object property, boolean newValue, boolean isTransient)
public void firePropertyChangedEvent(Object property, boolean oldValue, boolean newValue, boolean isTransient)
public void firePropertyChangedEvent(Object property, int oldValue, int newValue, boolean isTransient)
public String toString()
toString
in class Object
public String getStringValue(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |