com.softslate.commerce.businessobjects.core
Class SettingsBean

java.lang.Object
  extended bycom.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended bycom.softslate.commerce.businessobjects.core.SettingsBean
All Implemented Interfaces:
BusinessObject, java.io.Serializable

public class SettingsBean
extends BaseBusinessObject
implements java.io.Serializable

Represents various settings used by the application, or a single setting. Settings for the application are stored in the npcSetting database table. The various settings represent everything from the default colors and fonts used by the display templates, to the names of the Java classes that implement various business object interfaces for the application.

An instance of SettingsBean is created in the Struts layer. It is initialized there through initialize(DAOFactory), which populates the map property with the results of a query on the npcSetting table. For each setting, an entry in the map is created with the setting code used as the key and its value as the key's value.

The SettingsBean instance created in the Struts layer is passed throughout the application to look up needed settings. The application's BusinessObjectFactory initializes each business object with the SettingsBean immediately after it creates it.

This class can also be used as an interface to the npcSetting database table, in which case it respresents a single setting. It stores each of that table's columns as properties to assist with inserts and updates.

Author:
David Tobey
See Also:
Serialized Form

Field Summary
(package private)  int ALL
           
private  java.lang.String code
          The code for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String description
          The description for this SettingsBean, when used as an interface to the npcSetting database table.
private  int integerValue
          The integerValue for this SettingsBean, when used as an interface to the npcSetting database table.
(package private) static org.apache.commons.logging.Log log
           
private  java.util.Map map
          The map of settings values for this SettingsBean.
private  java.lang.String mediumValue
          The mediumValue for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String name
          The name for this SettingsBean, when used as an interface to the npcSetting database table.
private static long serialVersionUID
           
private  int settingID
          The settingID for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String smallValue
          The smallValue for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String textValue
          The textValue for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String type
          The type for this SettingsBean, when used as an interface to the npcSetting database table.
private  java.lang.String valueType
          The value type for this SettingsBean, when used as an interface to the npcSetting database table.
 
Constructor Summary
SettingsBean()
           
 
Method Summary
 java.lang.String getCode()
           
 java.lang.String getDescription()
           
 int getIntegerValue()
           
 java.util.Map getMap()
          Retrieves the map of settings values for this SettingsBean.
 java.lang.String getMediumValue()
           
 java.lang.String getName()
           
 int getSettingID()
           
 java.lang.String getSmallValue()
           
 java.lang.String getTextValue()
           
 java.lang.String getType()
           
 java.lang.Object getValue(java.lang.String key)
          Gets the value of a given key in this SettingsBean's map.
 java.lang.String getValueType()
           
 void initialize(DAOFactory daoFactory)
          Initializes this SettingsBean.
 void setCode(java.lang.String code)
           
 void setDescription(java.lang.String description)
           
 void setIntegerValue(int integerValue)
           
 void setMap(java.util.Map map)
          Sets the map of settings values for this SettingsBean.
 void setMediumValue(java.lang.String mediumValue)
           
 void setName(java.lang.String name)
           
 void setSettingID(int settingID)
           
 void setSmallValue(java.lang.String smallValue)
           
 void setTextValue(java.lang.String textValue)
           
 void setType(java.lang.String type)
           
 void setValue(java.lang.String key, java.lang.Object value)
          Sets the value of a given key in this SettingsBean's map.
 void setValueType(java.lang.String valueType)
           
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessObject
formatDateTime, initialize, parseDateTime, prepareRequestData, sendHTTPPost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ALL

final int ALL
See Also:
Constant Field Values

log

static org.apache.commons.logging.Log log

map

private java.util.Map map
The map of settings values for this SettingsBean. The keys of this Map correspond to the code field of the npcSetting database table. The values correspond to whichever value field (integerValue, smallValue, mediumValue, or textValue) is not null in npcSetting.


settingID

private int settingID
The settingID for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.settingID.


code

private java.lang.String code
The code for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.code.


name

private java.lang.String name
The name for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.name.


description

private java.lang.String description
The description for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.description.


type

private java.lang.String type
The type for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.type.


valueType

private java.lang.String valueType
The value type for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.valueType.


integerValue

private int integerValue
The integerValue for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.integerValue.


smallValue

private java.lang.String smallValue
The smallValue for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.smallValue.


mediumValue

private java.lang.String mediumValue
The mediumValue for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.mediumValue.


textValue

private java.lang.String textValue
The textValue for this SettingsBean, when used as an interface to the npcSetting database table. Corresponds to npcSetting.textValue.

Constructor Detail

SettingsBean

public SettingsBean()
Method Detail

getMap

public java.util.Map getMap()
Retrieves the map of settings values for this SettingsBean. The keys of this Map correspond to the code field of the npcSetting database table. The values correspond to whichever value field (integerValue, smallValue, mediumValue, or textValue) is not null in npcSetting.

Returns:
The map of settings keys and values for this SettingsBean.

setMap

public void setMap(java.util.Map map)
Sets the map of settings values for this SettingsBean. The keys of this Map correspond to the code field of the npcSetting database table. The values correspond to whichever value field (integerValue, smallValue, mediumValue, or textValue) is not null in npcSetting.

Returns:
The map of settings values for this SettingsBean.

getSettingID

public int getSettingID()

setSettingID

public void setSettingID(int settingID)

getCode

public java.lang.String getCode()

setCode

public void setCode(java.lang.String code)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

getValueType

public java.lang.String getValueType()

setValueType

public void setValueType(java.lang.String valueType)

getIntegerValue

public int getIntegerValue()

setIntegerValue

public void setIntegerValue(int integerValue)

getSmallValue

public java.lang.String getSmallValue()

setSmallValue

public void setSmallValue(java.lang.String smallValue)

getMediumValue

public java.lang.String getMediumValue()

setMediumValue

public void setMediumValue(java.lang.String mediumValue)

getTextValue

public java.lang.String getTextValue()

setTextValue

public void setTextValue(java.lang.String textValue)

setValue

public void setValue(java.lang.String key,
                     java.lang.Object value)
Sets the value of a given key in this SettingsBean's map.

Parameters:
key - The key whose value is being set
value - The value.
Throws:
java.lang.Exception

getValue

public java.lang.Object getValue(java.lang.String key)
Gets the value of a given key in this SettingsBean's map.

Parameters:
key - The key whose value is to be retrieved.
Returns:
The value of the setting.
Throws:
java.lang.Exception

initialize

public void initialize(DAOFactory daoFactory)
                throws java.lang.Exception
Initializes this SettingsBean. Populates the map property with the results of a query on the npcSetting database table.

Throws:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005