Package  Use  Tree  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

 

jve.generated
Class ObjectReference

java.lang.Object
  extended byjve.generated.ObjectReference

All Implemented Interfaces:
IBoundObject

Direct Known Subclasses:
BasicDataObject, DataSourceDataRows


public class ObjectReference
extends java.lang.Object
implements IBoundObject

This class is a wrapper that references an Object: boundObject. The boundObject is noted by [Object, property]. If a property is given, the boundObject is Object.getProperty(), eithewise it boundObject == Object. A property can be nested. i.e., the boundObject for [Object, "foo.bar"] is Object.getFoo().getBar()

The ObjectReference class provide property resolution, and event modeling support for bounded properties.


Field Summary
static boolean debug
           
 

Fields inherited from interface jve.generated.IBoundObject
DELIMITER, PROPERTY_OBJ_CHANGED
 

Constructor Summary
ObjectReference()
          Construct an uninitialized ObjectReference
ObjectReference(java.lang.Object source, java.lang.String property)
          Construct an ObjectReference initialized with its source object and property.
 

Method Summary
 void actionPerformed(IActionBinder action)
          Notify an argument of an action.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a propertyChangeListener that will listen to property changes on the object being referenced (the final object, including the value of subproperties).
protected  void addPropertyListeners()
           
protected  void firePropertyChanged(java.beans.PropertyChangeEvent event)
           
protected  void firePropertyChanged(java.lang.String property, java.lang.Object oldVal, java.lang.Object newVal)
           
protected  java.lang.String getErrorMessage()
           
 java.lang.Object getObject()
          Get the value of this ObjectReference.
 java.lang.String getProperty()
          Return the property of the source object being referenced by this ObjectReference
protected  java.lang.Object getPureSourceObject()
          Get the final source object being referenced.
 java.lang.Object getSourceObject()
          Get the source object that's bound to this ObjectReference
 java.lang.Class getType()
          Get the type of the ObjectReference.
protected  void log(java.lang.String s)
           
protected  void log(java.lang.Throwable t)
          The log(xxx) methods are called in case of a failure.
 void refresh()
          Refresh this ObjectReference.
protected  void refreshPropertyHelper()
          Create and cache a new PropertyHelper to reflect the current source object and property.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove an existing property change listener from the listener list.
protected  void removePropertyListeners()
           
 void setProperty(java.lang.String property)
          Set the property to be used for this ObjectReference.
 void setSourceObject(java.lang.Object obj)
          Set the source object this ObjectReference will be bound to.
 void setSourceObject(java.lang.Object object, java.lang.String property)
          Set the source object and target property simultaneously.
 java.lang.String toString()
           
 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

 

Field Detail

 

 

debug

public static boolean debug

Constructor Detail

 

 

ObjectReference

public ObjectReference()

Construct an uninitialized ObjectReference


 

 

ObjectReference

public ObjectReference(java.lang.Object source,
                       java.lang.String property)

Construct an ObjectReference initialized with its source object and property.

Parameters:
source - the source object
property - a property on the source object (may be null)

Method Detail

 

 

log

protected void log(java.lang.Throwable t)

The log(xxx) methods are called in case of a failure. Data Objects and binders do not intend to provide any error validation framework. The default logging support will use the error stream if the -Djve.debug system property is defined. One can override these methods to hook up to a particular error validation/framework

Parameters:
t - Exceptions


 

 

log

protected void log(java.lang.String s)


 

 

getProperty

public java.lang.String getProperty()

Return the property of the source object being referenced by this ObjectReference

Specified by:
getProperty in interface IBoundObject

Returns:
Returns the property.


 

 

getPureSourceObject

protected java.lang.Object getPureSourceObject()

Get the final source object being referenced. If the source object is a IBoundObject, this will return the source's object. resolve a IBoundObject


 

 

refreshPropertyHelper

protected void refreshPropertyHelper()

Create and cache a new PropertyHelper to reflect the current source object and property. If the property is null, the PropertyHelper will be null.


 

 

refresh

public void refresh()

Refresh this ObjectReference. This implementation will update the ObjectReference's cached PropertyHelper.

Specified by:
refresh in interface IBoundObject


 

 

setProperty

public void setProperty(java.lang.String property)

Set the property to be used for this ObjectReference. If the property is null, the ObjectReference will reference the source object directly.

Specified by:
setProperty in interface IBoundObject

Parameters:
property - is the property to use on #getObject


 

 

getSourceObject

public java.lang.Object getSourceObject()

Get the source object that's bound to this ObjectReference

Specified by:
getSourceObject in interface IBoundObject

Returns:
the source object


 

 

removePropertyListeners

protected void removePropertyListeners()


 

 

addPropertyListeners

protected void addPropertyListeners()


 

 

setSourceObject

public void setSourceObject(java.lang.Object obj)

Set the source object this ObjectReference will be bound to.

Specified by:
setSourceObject in interface IBoundObject

Parameters:
obj - the source object


 

 

setSourceObject

public void setSourceObject(java.lang.Object object,
                            java.lang.String property)

Description copied from interface: IBoundObject
Set the source object and target property simultaneously. Using this method will prevent multiple event firings of changing both the sourceObject and property separately.

Specified by:
setSourceObject in interface IBoundObject

Parameters:
object - the source object
property - the target property


 

 

getObject

public java.lang.Object getObject()

Get the value of this ObjectReference. If the ObjectReference has a sourceObject and property set, the return value will be the result of calling sourceObject.get[Property](). Otherwise the return value will be the sourceObject.

Specified by:
getObject in interface IBoundObject

Returns:
resolved object reference.


 

 

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

Add a propertyChangeListener that will listen to property changes on the object being referenced (the final object, including the value of subproperties).

Specified by:
addPropertyChangeListener in interface IBoundObject

Parameters:
l - the listener to add.


 

 

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

Remove an existing property change listener from the listener list.

Specified by:
removePropertyChangeListener in interface IBoundObject

Parameters:
l - the listener to remove.


 

 

actionPerformed

public void actionPerformed(IActionBinder action)

Notify an argument of an action. This action will be delegated to the sourceObject if it is a IBoundObject.

Specified by:
actionPerformed in interface IBoundObject

Parameters:
action - the action that has occurred.
See Also:
IActionBinder


 

 

firePropertyChanged

protected void firePropertyChanged(java.lang.String property,
                                   java.lang.Object oldVal,
                                   java.lang.Object newVal)


 

 

firePropertyChanged

protected void firePropertyChanged(java.beans.PropertyChangeEvent event)


 

 

getType

public java.lang.Class getType()
                        throws java.lang.IllegalStateException

Get the type of the ObjectReference. If the property is set, this will be the return type of the sourceObject.get[Property]() method. Otherwise it will be the type of the sourceObject.

Specified by:
getType in interface IBoundObject

Returns:
the Class type of the configured object. If it is an array or a List, it will return the type of the elements that comprises the array or List rather than the type array or List type.
Throws:
java.lang.IllegalStateException - if the target object can not be determined due to a miss-configuration. The exception includes a message denoting the reason.


 

 

getErrorMessage

protected java.lang.String getErrorMessage()


 

 

toString

public java.lang.String toString()


Package  Use  Tree  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD