com.loribel.commons.business
Class GB_BusinessObjectSimpleAbstract

java.lang.Object
  extended bycom.loribel.commons.business.GB_BusinessObjectSimpleAbstract
All Implemented Interfaces:
GB_BOParentOwner, GB_BOParentOwnerSet, GB_BOValueOwner, GB_LabelInfoOwner, GB_MementoCompliant, GB_SimpleBusinessObject, GB_SimpleBusinessObjectSet
Direct Known Subclasses:
GB_BusinessObjectBasic, GB_BusinessObjectSimple

public abstract class GB_BusinessObjectSimpleAbstract
extends java.lang.Object
implements GB_SimpleBusinessObjectSet, GB_BOValueOwner, GB_BOParentOwnerSet, GB_MementoCompliant

Default implementation for BusinessObject.

Author:
Gregory Borelli

Field Summary
protected  java.lang.String boName
           
protected  GB_SimpleBusinessObjectSet boParent
           
protected  boolean modified
           
protected  boolean readOnly
           
protected  java.util.Map valueMap
           
 
Constructor Summary
GB_BusinessObjectSimpleAbstract(java.lang.String a_boName)
           
 
Method Summary
 void addPropertyValue(java.lang.String a_propertyName, java.lang.Object a_value)
          Add a value for the property a_propertyName
 java.lang.String getBOName()
          Returns the BO Name of the objet.
 GB_SimpleBusinessObjectSet getBoParent()
           
 GB_SimpleBOValue getBOValue(java.lang.String a_propertyName)
          Return the BusinessObjectValue associated to a property.
 java.lang.String getLabelInfo()
          Vous pouvez redéfinir cette méthode si vous voulez afficher plus d'info sur vos objets.
 java.lang.Object getPropertyValue(java.lang.String a_propertyName)
          Returns the value associated to a property.
 void installMemento(GB_Memento a_memento)
          Install a memento for this BusinessObject.
 boolean isModified()
          Returns true if this object has been modified.
 boolean isReadOnly()
          Returns true if the businessObject is ReadOnly.
 GB_Memento newMemento()
          Create a new memento for this BusinessObject.
 void putPropertyValueMap(java.lang.String a_propertyName, java.lang.String a_name, java.lang.Object a_value)
          Add a value for the property a_propertyName
 void removePropertyValue(java.lang.String a_propertyName, java.lang.Object a_value)
          Remove a value for the property a_propertyName
 void removePropertyValueMap(java.lang.String a_propertyName, java.lang.String a_name)
          Remove a value for the property a_propertyName
 void setBoParent(GB_SimpleBusinessObjectSet a_boParent)
           
 void setModified(boolean a_modified)
           
 void setReadOnly(boolean a_readOnly)
          Set the businessObject read-only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.loribel.commons.business.abstraction.GB_SimpleBusinessObjectSet
setPropertyValue
 
Methods inherited from interface com.loribel.commons.business.abstraction.GB_SimpleBusinessObject
getProperty, getPropertyNames
 

Field Detail

boName

protected java.lang.String boName

boParent

protected GB_SimpleBusinessObjectSet boParent

modified

protected boolean modified

readOnly

protected boolean readOnly

valueMap

protected java.util.Map valueMap
Constructor Detail

GB_BusinessObjectSimpleAbstract

public GB_BusinessObjectSimpleAbstract(java.lang.String a_boName)
Method Detail

addPropertyValue

public void addPropertyValue(java.lang.String a_propertyName,
                             java.lang.Object a_value)
Description copied from interface: GB_SimpleBusinessObjectSet
Add a value for the property a_propertyName

Specified by:
addPropertyValue in interface GB_SimpleBusinessObjectSet
Parameters:
a_propertyName - String -
a_value - Object -

getBOName

public java.lang.String getBOName()
Description copied from interface: GB_SimpleBusinessObject
Returns the BO Name of the objet. It is an important value, because generaly we can retrieve property using the BOFactory.

Specified by:
getBOName in interface GB_SimpleBusinessObject
Returns:
String

getBoParent

public GB_SimpleBusinessObjectSet getBoParent()
Specified by:
getBoParent in interface GB_BOParentOwner

getBOValue

public GB_SimpleBOValue getBOValue(java.lang.String a_propertyName)
Description copied from interface: GB_BOValueOwner
Return the BusinessObjectValue associated to a property.

Specified by:
getBOValue in interface GB_BOValueOwner
Parameters:
a_propertyName - String -
Returns:
GB_SimpleBusinessObjectValue

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String a_propertyName)
Description copied from interface: GB_SimpleBusinessObject
Returns the value associated to a property. This method can return a collection of values if necessary

Specified by:
getPropertyValue in interface GB_SimpleBusinessObject
Parameters:
a_propertyName - String -
Returns:
Object

installMemento

public void installMemento(GB_Memento a_memento)
Install a memento for this BusinessObject. Restore each single property value of memento to this BusinessObject. For multi property : - clear the list of the values - restore the old list (item by item)

Specified by:
installMemento in interface GB_MementoCompliant
Parameters:
a_memento - GB_Memento - the memento to use

isModified

public boolean isModified()
Description copied from interface: GB_SimpleBusinessObject
Returns true if this object has been modified. If a complex property has been changed, this method may return false if no direct modifications has beeen done to the simple properties of this object.

Specified by:
isModified in interface GB_SimpleBusinessObject
Returns:
boolean

isReadOnly

public boolean isReadOnly()
Description copied from interface: GB_SimpleBusinessObject
Returns true if the businessObject is ReadOnly.

Specified by:
isReadOnly in interface GB_SimpleBusinessObject
Returns:
boolean

newMemento

public GB_Memento newMemento()
Create a new memento for this BusinessObject. For single property keep the value For multi property clone the list of values in a new List (no deep clone).

Specified by:
newMemento in interface GB_MementoCompliant
Returns:
GB_Memento

putPropertyValueMap

public void putPropertyValueMap(java.lang.String a_propertyName,
                                java.lang.String a_name,
                                java.lang.Object a_value)
Description copied from interface: GB_SimpleBusinessObjectSet
Add a value for the property a_propertyName

Specified by:
putPropertyValueMap in interface GB_SimpleBusinessObjectSet
Parameters:
a_propertyName - String -
a_value - Object -

removePropertyValue

public void removePropertyValue(java.lang.String a_propertyName,
                                java.lang.Object a_value)
Description copied from interface: GB_SimpleBusinessObjectSet
Remove a value for the property a_propertyName

Specified by:
removePropertyValue in interface GB_SimpleBusinessObjectSet
Parameters:
a_propertyName - String -
a_value - Object -

removePropertyValueMap

public void removePropertyValueMap(java.lang.String a_propertyName,
                                   java.lang.String a_name)
Description copied from interface: GB_SimpleBusinessObjectSet
Remove a value for the property a_propertyName

Specified by:
removePropertyValueMap in interface GB_SimpleBusinessObjectSet
Parameters:
a_propertyName - String -

setBoParent

public void setBoParent(GB_SimpleBusinessObjectSet a_boParent)
Specified by:
setBoParent in interface GB_BOParentOwnerSet

setModified

public void setModified(boolean a_modified)
Specified by:
setModified in interface GB_SimpleBusinessObjectSet

setReadOnly

public void setReadOnly(boolean a_readOnly)
Description copied from interface: GB_SimpleBusinessObjectSet
Set the businessObject read-only.

Specified by:
setReadOnly in interface GB_SimpleBusinessObjectSet

getLabelInfo

public java.lang.String getLabelInfo()
Vous pouvez redéfinir cette méthode si vous voulez afficher plus d'info sur vos objets.

Specified by:
getLabelInfo in interface GB_LabelInfoOwner


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