com.altair.hwm.toolkit.binding
Class HWMBindingInfo

java.lang.Object
  extended by com.altair.hwm.toolkit.binding.HWMBindingInfo
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class HWMBindingInfo
extends java.lang.Object
implements java.io.Externalizable

Title: HWMBindingInfo

Description: This is mainly a structure that holds all information pertaining to binding two beans together.

Company: Altair Engineering, Inc.

See Also:
Serialized Form

Field Summary
static int BINDING_EVENTS
          The binding is from an event to a method
static int BINDING_PROPERTIES
          The property in the source bean is bounded to a property in someother bean
static java.lang.String VERSION
          The version for this class
 
Constructor Summary
HWMBindingInfo()
          Constructor.
 
Method Summary
 void ExtractPropertyClass(java.beans.BeanInfo beanInfo)
          Called by LoadTemplate.
 java.lang.Object GetAdapterClass()
          Get the adapter class.
 java.lang.String GetAdapterClassName()
          Get the name of the adapter class that has been written for this binding
 int GetBindingType()
          Get the binding type, viz.
 java.lang.String GetListenerMethod()
          Get the listener method name that needs to be overridden
 java.lang.Class GetPropertyClass()
          Gets the property's type as a class type
 int GetSourceBeanID()
          Get ID the of the source bean involved in this binding operation
 java.beans.EventSetDescriptor GetSourceEventSetDescriptor()
          Get the eventset descriptor of the source bean involved in this binding
 int GetSourcePageID()
          Get ID the of the page containing the source bean involved in this binding operation
 java.lang.String GetSrcPropName()
          Gets the src property's name
 int GetTargetBeanID()
          Get ID the of the target bean involved in this binding operation
 java.lang.String GetTargetMethod()
          Get method name of the target bean involved in this binding
 int GetTargetPageID()
          Get ID the of the page containing the target bean involved in this binding operation
 java.lang.String GetTargetPropName()
          Gets the target property's name
 java.lang.String GetTargetPropWriteMethodName()
          Gets the target property's write method name
 void readExternal(java.io.ObjectInput objInput)
          This method belongs to the Externalizable interface and is called to save this object
 void ReadVersion1_0(java.io.ObjectInput objInput)
          This reads the 1.0 version class memebers
 void SetAdapterClass(java.lang.Object objAdapterClass)
          Set the adapter class.
 void SetAdapterClassName(java.lang.String szAdapterClass)
          Set the name of the adapter class that has been written for this binding
 void SetBindingType(int nBindingType)
          Set the binding type, viz.
 void SetPropertyClass(java.lang.Class classPropType)
          Sets the clss type of the property that is binded
 boolean SetSourceEventInfo(int nSrcPgID, int nSrcBeanID, java.beans.EventSetDescriptor eventSetDescriptor, java.lang.String szListenerMethod)
          Set all the inforation pertaining to the source bean event description
 boolean SetSourcePropertyInfo(int nSrcPgID, int nSrcBeanID, java.beans.PropertyDescriptor propSourceBean)
          Set all the inforation pertaining to the source bean's property
 boolean SetTargetMethodInfo(int nTargetPgID, int nTargetBeanID, java.lang.String szMethod)
          Set all the inforation pertaining to the target bean method to call
 boolean SetTargetPropertyInfo(int nTargetPgID, int nTargetBeanID, java.beans.PropertyDescriptor propTargetBean)
          Set all the inforation pertaining to the target bean's properties
 void writeExternal(java.io.ObjectOutput objOutput)
          This method belongs to the Externalizable interface and is called to save this object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static java.lang.String VERSION
The version for this class


BINDING_EVENTS

public static final transient int BINDING_EVENTS
The binding is from an event to a method

See Also:
Constant Field Values

BINDING_PROPERTIES

public static final transient int BINDING_PROPERTIES
The property in the source bean is bounded to a property in someother bean

See Also:
Constant Field Values
Constructor Detail

HWMBindingInfo

public HWMBindingInfo()
Constructor. Set everything to defaults

Method Detail

SetAdapterClass

public void SetAdapterClass(java.lang.Object objAdapterClass)
Set the adapter class. This is required to add/remove the adapter class as a listener for the source's events before/after saving the project respectively.

Parameters:
objAdapterClass -

GetAdapterClass

public java.lang.Object GetAdapterClass()
Get the adapter class. This is required to add/remove the adapter class as a listener for the source's events before/after saving the project respectively.

Returns:
Object The adapter class instance

SetBindingType

public void SetBindingType(int nBindingType)
Set the binding type, viz. whether the properties are bound together, or an event in the source bean is bound to a method in the target bean.

Parameters:
nBindingType - -- The binding type. It can be one of the following: BINDING_EVENTS or BINDING_PROPERTIES

GetBindingType

public int GetBindingType()
Get the binding type, viz. whether the properties are bound together, or an event in the source bean is bound to a method in the target bean.

Returns:
int The binding type. It can be one of the following three BINDING_NONE, BINDING_EVENTS or BINDING_PROPERTIES

SetSourceEventInfo

public boolean SetSourceEventInfo(int nSrcPgID,
                                  int nSrcBeanID,
                                  java.beans.EventSetDescriptor eventSetDescriptor,
                                  java.lang.String szListenerMethod)
Set all the inforation pertaining to the source bean event description

Parameters:
szBeanClass - -- The classname of the bean
nSrcPgID - -- The source bean's page ID
nSrcBeanID - -- The source bean's ID
eventSetDescriptor - -- The source bean's event set descriptor
szListenerMethod - -- The method in the listener to be overridden
Returns:
true=>success; false=>failure

SetTargetMethodInfo

public boolean SetTargetMethodInfo(int nTargetPgID,
                                   int nTargetBeanID,
                                   java.lang.String szMethod)
Set all the inforation pertaining to the target bean method to call

Parameters:
szBeanClass - -- The classname of the target bean
nTargetPgID - -- The target bean's page ID
nTargetBeanID - -- The target bean's ID
szMethod - -- The target bean's method/property name that is being bound to
Returns:
true=>success; false=>failure

SetSourcePropertyInfo

public boolean SetSourcePropertyInfo(int nSrcPgID,
                                     int nSrcBeanID,
                                     java.beans.PropertyDescriptor propSourceBean)
Set all the inforation pertaining to the source bean's property

Parameters:
szBeanClass - -- The classname of the bean
nSrcPgID - -- The source bean's page ID
nSrcBeanID - -- The source bean's ID
propSourceBean - -- The source bean's descriptor of the property
Returns:
true=>success; false=>failure

SetTargetPropertyInfo

public boolean SetTargetPropertyInfo(int nTargetPgID,
                                     int nTargetBeanID,
                                     java.beans.PropertyDescriptor propTargetBean)
Set all the inforation pertaining to the target bean's properties

Parameters:
szBeanClass - -- The classname of the target bean
nTargetPgID - -- The target bean's page ID
nTargetBeanID - -- The target bean's ID
propTargetBean - -- The target bean's descriptor of te property
Returns:
true=>success; false=>failure

GetSourcePageID

public int GetSourcePageID()
Get ID the of the page containing the source bean involved in this binding operation

Returns:
The ID of the source page

GetSourceBeanID

public int GetSourceBeanID()
Get ID the of the source bean involved in this binding operation

Returns:
The ID of the source bean

GetTargetPageID

public int GetTargetPageID()
Get ID the of the page containing the target bean involved in this binding operation

Returns:
The ID of the target page

GetTargetBeanID

public int GetTargetBeanID()
Get ID the of the target bean involved in this binding operation

Returns:
The ID of the target bean

GetSourceEventSetDescriptor

public java.beans.EventSetDescriptor GetSourceEventSetDescriptor()
Get the eventset descriptor of the source bean involved in this binding

Returns:
EventSetDescriptor The event set descriptor

GetListenerMethod

public java.lang.String GetListenerMethod()
Get the listener method name that needs to be overridden

Returns:
String The listener method ame

GetTargetMethod

public java.lang.String GetTargetMethod()
Get method name of the target bean involved in this binding

Returns:
The name(String) of the method

SetAdapterClassName

public void SetAdapterClassName(java.lang.String szAdapterClass)
Set the name of the adapter class that has been written for this binding

Parameters:
szAdapterClass - The adapter class name

GetAdapterClassName

public java.lang.String GetAdapterClassName()
Get the name of the adapter class that has been written for this binding

Returns:
String The adapter class name

GetSrcPropName

public java.lang.String GetSrcPropName()
Gets the src property's name

Returns:
String The source's property name

GetTargetPropName

public java.lang.String GetTargetPropName()
Gets the target property's name

Returns:
String The target property's name

GetTargetPropWriteMethodName

public java.lang.String GetTargetPropWriteMethodName()
Gets the target property's write method name

Returns:
String Target property's write method name

SetPropertyClass

public void SetPropertyClass(java.lang.Class classPropType)
Sets the clss type of the property that is binded

Parameters:
classPropType - The Class object representing the property's type

GetPropertyClass

public java.lang.Class GetPropertyClass()
Gets the property's type as a class type

Returns:
Class property's class type

ExtractPropertyClass

public void ExtractPropertyClass(java.beans.BeanInfo beanInfo)
                          throws java.lang.Exception
Called by LoadTemplate. For this binding info passed it will fill find the property type class required for re-creating property binding and set the property class

Parameters:
The - bean info for the source bean
Throws:
java.lang.Exception

readExternal

public void readExternal(java.io.ObjectInput objInput)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
This method belongs to the Externalizable interface and is called to save this object

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
objInput - The input stream that needs to be read
Throws:
IOException, - ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

ReadVersion1_0

public void ReadVersion1_0(java.io.ObjectInput objInput)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
This reads the 1.0 version class memebers

Parameters:
objInput - The input stream that needs to be read
Throws:
IOException, - ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput objOutput)
                   throws java.io.IOException
This method belongs to the Externalizable interface and is called to save this object

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
objOutput - The input stream that needs to be read
Throws:
java.io.IOException