com.loribel.commons.business
Class GB_BOValueAbstract

java.lang.Object
  extended bycom.loribel.commons.business.GB_BOValueAbstract
All Implemented Interfaces:
GB_MyPropertyOwner, GB_SimpleBOValue, GB_SimpleBOValueSet
Direct Known Subclasses:
GB_BOValueMap, GB_BOValueMulti, GB_BOValueSingle

public abstract class GB_BOValueAbstract
extends java.lang.Object
implements GB_SimpleBOValueSet, GB_MyPropertyOwner

Default abstract implementation of GB_SimpleBOValue.

Author:
Gregory Borelli

Field Summary
protected  GB_SimpleBusinessObjectSet businessObject
          The BusinessObject linked to this value.
protected  GB_BOProperty property
          Meta data of the value (BusinessObject property).
 
Constructor Summary
GB_BOValueAbstract(GB_SimpleBusinessObjectSet a_businessObject, GB_BOProperty a_property)
          Constructor of GB_SimpleBusinessObjectValueAbstract with parameter(s).
GB_BOValueAbstract(GB_SimpleBusinessObjectSet a_businessObject, java.lang.String a_propertyName)
          Constructor of GB_SimpleBusinessObjectValueAbstract with parameter(s).
 
Method Summary
 void addMyPropertyChangeListener(GB_MyPropertyChangeListener a_listener)
          Add a MyPropertyChangeListener to the listener list.
 void addMyPropertyChangeListener(java.lang.String a_property, GB_MyPropertyChangeListener a_listener)
          Add a MyPropertyChangeListener for a specific property.
protected abstract  void checkWithProperty()
           
protected  void fireMyPropertyChange(java.lang.String a_propertyName, java.lang.Object a_oldValue, java.lang.Object a_newValue)
          Report a property update to any registered listeners.
 GB_SimpleBusinessObjectSet getBusinessObject()
          Get The BusinessObject linked to this value..
 GB_BOProperty getProperty()
          Get Meta data of the value (BusinessObject property)..
 java.lang.String getPropertyName()
          return the property name corresponding to this value.
 java.lang.Class getType()
          Return the type of value.
 boolean isBusinessObject()
          Return true if the property is assignable to BusinessObject.
 boolean isMultiValue()
          Return true if this object represent a list of values.
 void removeMyPropertyChangeListener(GB_MyPropertyChangeListener a_listener)
          Remove a GB_PropertyChangeListener from the listener list.
 void removeMyPropertyChangeListener(java.lang.String a_property, GB_MyPropertyChangeListener a_listener)
          Remove a GB_PropertyChangeListener for a specific property.
protected  void setBusinessObject(GB_SimpleBusinessObjectSet a_businessObject)
          Set The BusinessObject linked to this value..
protected  void setProperty(GB_BOProperty a_property)
          Set Meta data of the value (BusinessObject property)..
protected  void setProperty(java.lang.String a_propertyName)
          Set the property by this name.
 java.lang.String toString()
          Use to debug.
 void updateValue(java.lang.Object a_newValue)
          Update the value of the property by setting a value of the property (see getPropertyName()) of the BusinessObject associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.loribel.commons.business.abstraction.GB_SimpleBOValue
getValue
 

Field Detail

businessObject

protected GB_SimpleBusinessObjectSet businessObject
The BusinessObject linked to this value.


property

protected GB_BOProperty property
Meta data of the value (BusinessObject property).

Constructor Detail

GB_BOValueAbstract

public GB_BOValueAbstract(GB_SimpleBusinessObjectSet a_businessObject,
                          GB_BOProperty a_property)
Constructor of GB_SimpleBusinessObjectValueAbstract with parameter(s).

Parameters:
a_businessObject - GB_SimpleBusinessObjectSet -
a_property - GB_BOProperty -

GB_BOValueAbstract

public GB_BOValueAbstract(GB_SimpleBusinessObjectSet a_businessObject,
                          java.lang.String a_propertyName)
Constructor of GB_SimpleBusinessObjectValueAbstract with parameter(s).

Parameters:
a_businessObject - GB_SimpleBusinessObjectSet -
a_propertyName - String -
Method Detail

addMyPropertyChangeListener

public void addMyPropertyChangeListener(GB_MyPropertyChangeListener a_listener)
Add a MyPropertyChangeListener to the listener list. The listener is registered for all properties.

Specified by:
addMyPropertyChangeListener in interface GB_MyPropertyOwner
Parameters:
a_listener - GB_MyPropertyChangeListener - the PropertyChangeListener to be added

addMyPropertyChangeListener

public void addMyPropertyChangeListener(java.lang.String a_property,
                                        GB_MyPropertyChangeListener a_listener)
Add a MyPropertyChangeListener for a specific property. The listener will be invoked only when a call on fireMyPropertyChange names that specific property.

Specified by:
addMyPropertyChangeListener in interface GB_MyPropertyOwner
Parameters:
a_property - String - the name of the property to listen on
a_listener - GB_MyPropertyChangeListener - the PropertyChangeListener to be added

checkWithProperty

protected abstract void checkWithProperty()

fireMyPropertyChange

protected void fireMyPropertyChange(java.lang.String a_propertyName,
                                    java.lang.Object a_oldValue,
                                    java.lang.Object a_newValue)
Report a property update to any registered listeners.

Parameters:
a_propertyName - String - the programmatic name of the property that was changed
a_oldValue - Object - the old value of the property
a_newValue - Object - the new value of the property

getBusinessObject

public GB_SimpleBusinessObjectSet getBusinessObject()
Get The BusinessObject linked to this value..

Specified by:
getBusinessObject in interface GB_SimpleBOValue
Returns:
GB_SimpleBusinessObjectSet - businessObject

getProperty

public GB_BOProperty getProperty()
Get Meta data of the value (BusinessObject property)..

Returns:
GB_BOProperty - property

getPropertyName

public java.lang.String getPropertyName()
return the property name corresponding to this value.

Specified by:
getPropertyName in interface GB_SimpleBOValue
Returns:
String

getType

public java.lang.Class getType()
Return the type of value.

Specified by:
getType in interface GB_SimpleBOValue
Returns:
Class

isBusinessObject

public boolean isBusinessObject()
Return true if the property is assignable to BusinessObject.

Returns:
boolean

isMultiValue

public boolean isMultiValue()
Return true if this object represent a list of values.

Returns:
boolean

removeMyPropertyChangeListener

public void removeMyPropertyChangeListener(GB_MyPropertyChangeListener a_listener)
Remove a GB_PropertyChangeListener from the listener list. This removes a GB_PropertyChangeListener that was registered for all properties.

Specified by:
removeMyPropertyChangeListener in interface GB_MyPropertyOwner
Parameters:
a_listener - GB_MyPropertyChangeListener - the PropertyChangeListener to be removed

removeMyPropertyChangeListener

public void removeMyPropertyChangeListener(java.lang.String a_property,
                                           GB_MyPropertyChangeListener a_listener)
Remove a GB_PropertyChangeListener for a specific property.

Specified by:
removeMyPropertyChangeListener in interface GB_MyPropertyOwner
Parameters:
a_property - String - the name of the property that was listened on
a_listener - GB_MyPropertyChangeListener - the PropertyChangeListener to be removed

setBusinessObject

protected void setBusinessObject(GB_SimpleBusinessObjectSet a_businessObject)
Set The BusinessObject linked to this value..

Parameters:
a_businessObject - GB_SimpleBusinessObjectSet - businessObject

setProperty

protected void setProperty(GB_BOProperty a_property)
Set Meta data of the value (BusinessObject property)..

Parameters:
a_property - GB_BOProperty - property

setProperty

protected void setProperty(java.lang.String a_propertyName)
Set the property by this name.

Parameters:
a_propertyName - String - the name of property

toString

public java.lang.String toString()
Use to debug.

Returns:
String

updateValue

public void updateValue(java.lang.Object a_newValue)
Update the value of the property by setting a value of the property (see getPropertyName()) of the BusinessObject associated. Cela permet en autre de pouvoir générer des évènement au niveau du BusinessObject.

Specified by:
updateValue in interface GB_SimpleBOValueSet
Parameters:
a_newValue - Object - the new value of the property


Copyright © 2002-2007 Gregory Borelli [Loribel]. All Rights Reserved.