ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able
Class AblePropertyConnection

java.lang.Object
  |
  +--com.ibm.able.AblePropertyConnection
All Implemented Interfaces:
java.io.Serializable

public class AblePropertyConnection
extends java.lang.Object
implements java.io.Serializable

The AblePropertyConnection defines a serializable connection between an AbleBean property and another AbleBean listener and its corresponding property. When the source bean fires a PropertyChangeEvent, the changed value gets sent to the target bean by its setter method.

See Also:
Serialized Form

Field Summary
protected  AbleBean destObj
          The bean listening for properties changing in the sourceObj.
protected  java.lang.reflect.Method getter
          The method used to obtain the value of the property srcPropertyName in the sourceObj.
protected  java.lang.String getterName
          The name of the method used to obtain the value of the property srcPropertyName.
protected  java.lang.reflect.Method setter
          The method used to set the value of the property targetPropertyName in the destObj.
protected  java.lang.String setterName
          The name of the method used to set the value of the property targetPropertyName.
protected  AbleBean sourceObj
          The bean owning the property whose value is changing.
protected  java.lang.String srcPropertyName
          The property of interest in the sourceObj.
protected  java.lang.String targetPropertyName
          The property to be changed in the destObj when the srcPropertyName changes.
protected  boolean valid
          true if connection is valid - otherwise false.
 
Constructor Summary
AblePropertyConnection(AbleBean source, java.lang.String srcPropertyName, AbleBean targetObject, java.lang.String targetPropertyName)
          Create a property connection, so that a change to the named bound property on the source object turns into a call on the "setter" method of the given target object.
AblePropertyConnection(AbleBean source, java.lang.String propertyName, java.lang.String getterName, AbleBean targetObject, java.lang.String setterName)
          Create a property connection, so that a change to the named bound property on the source object turns into a call on the "setter" method of the given target object.
 
Method Summary
 AbleBean getDest()
          Returns the bean listening for changes to the property of interest.
 java.lang.reflect.Method getGetter()
          Returns the method which provides the value of the property of interest.
 java.lang.reflect.Method getSetter()
          Returns the method used to update the listening bean when the property of interest changes.
 java.lang.String getSetterName()
          Returns the name of the method used to update the listening bean when the property of interest changes.
 AbleBean getSource()
          Returns the bean which owns the property of interest.
 java.lang.String getSrcPropertyName()
          Returns the name of the property of interest.
 java.lang.String getTargetPropertyName()
          Returns the name of the property to be updated in the listening bean when the property of interest changes.
 java.lang.String toString()
          Returns the property connection formatted as a string for display in the format: sourceBeanName:sourcePropertyName...targetBeanName:targetPropertyName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceObj

protected AbleBean sourceObj
The bean owning the property whose value is changing.

destObj

protected AbleBean destObj
The bean listening for properties changing in the sourceObj.

getter

protected transient java.lang.reflect.Method getter
The method used to obtain the value of the property srcPropertyName in the sourceObj.

setter

protected transient java.lang.reflect.Method setter
The method used to set the value of the property targetPropertyName in the destObj.

getterName

protected java.lang.String getterName
The name of the method used to obtain the value of the property srcPropertyName.

setterName

protected java.lang.String setterName
The name of the method used to set the value of the property targetPropertyName.

srcPropertyName

protected java.lang.String srcPropertyName
The property of interest in the sourceObj.

targetPropertyName

protected java.lang.String targetPropertyName
The property to be changed in the destObj when the srcPropertyName changes.

valid

protected boolean valid
true if connection is valid - otherwise false.
Constructor Detail

AblePropertyConnection

public AblePropertyConnection(AbleBean source,
                              java.lang.String propertyName,
                              java.lang.String getterName,
                              AbleBean targetObject,
                              java.lang.String setterName)
                       throws AbleException
Create a property connection, so that a change to the named bound property on the source object turns into a call on the "setter" method of the given target object.

This constructor assumes the source srcPropertyName and target targetPropertyName have the same name.

Parameters:
source - The bean owning the property of interest.
propertyName - The property of interest in that source bean.
getterName - The name of the method which returns the property of interest.
targetObject - The bean listening for changes in the specified property.
setterName - The method to be called on listening bean's when the specified property changes.
Throws:
AbleException - If an error occurs,such as when there is no 'getter' method for the source or there is no 'setter' method for the target for the specified property name.

AblePropertyConnection

public AblePropertyConnection(AbleBean source,
                              java.lang.String srcPropertyName,
                              AbleBean targetObject,
                              java.lang.String targetPropertyName)
                       throws java.rmi.RemoteException
Create a property connection, so that a change to the named bound property on the source object turns into a call on the "setter" method of the given target object.

This constructor uses introspection to resolve the getter/setter methods.

Parameters:
source - The bean owning the property of interest.
srcPropertyName - The property of interest in that source bean.
targetObject - The bean listening for changes in the specified property.
targetPropertyName - The property to be set in the target bean.
Throws:
AbleException - If an error occurs,such as when there is no 'getter' method for the source or there is no 'setter' method for the target for the specified property name.
Method Detail

getSource

public AbleBean getSource()
Returns the bean which owns the property of interest.

getDest

public AbleBean getDest()
Returns the bean listening for changes to the property of interest.

getSrcPropertyName

public java.lang.String getSrcPropertyName()
Returns the name of the property of interest.

getTargetPropertyName

public java.lang.String getTargetPropertyName()
Returns the name of the property to be updated in the listening bean when the property of interest changes.

getSetterName

public java.lang.String getSetterName()
Returns the name of the method used to update the listening bean when the property of interest changes.

getSetter

public java.lang.reflect.Method getSetter()
Returns the method used to update the listening bean when the property of interest changes.

getGetter

public java.lang.reflect.Method getGetter()
Returns the method which provides the value of the property of interest.

toString

public java.lang.String toString()
Returns the property connection formatted as a string for display in the format: sourceBeanName:sourcePropertyName...targetBeanName:targetPropertyName.
Overrides:
toString in class java.lang.Object

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003