org.scubatoolkit
Class Settings

java.lang.Object
  |
  +--org.scubatoolkit.Settings

public class Settings
extends java.lang.Object

This class manages the settings of the application. The init() * method should be called at the beginning of the application to * load the settings files. * * @author Javier Vilalta * @author Lee Turner * @version 1.0


Field Summary
static java.lang.String activityLogFileName
           
static java.lang.String configFileName
           
private static Settings instance
           
private static Logger log
           
private  Document scubaToolkitConfig
           
static java.lang.String settingsDirectoryName
           
 
Constructor Summary
private Settings()
          Constructor for the Settings object
 
Method Summary
 java.lang.String getActivityLogPath()
          Gets the path to the access log file * * @return The path to the access log file
 boolean getBooleanSetting(java.lang.String settingName)
          Returns the value of a boolean property returning false * if not defined.
 boolean getBooleanSetting(java.lang.String settingName, boolean def)
          Returns the value of a boolean property returning the default value * if not defined.
 java.lang.String getBuildDate()
          Gets the buildDate attribute of the Settings object * * @return The buildDate value
 double getDoubleSetting(java.lang.String settingName, double def)
          Returns the value of an double property returning the default value * if not defined.
static Settings getInstance()
          Gets the instance attribute of the Settings class * * @return The instance value
 int getIntegerSetting(java.lang.String settingName, int def)
          Returns the value of an integer property returning the default value * if not defined.
 java.lang.String getSetting(java.lang.String settingName)
          Gets a setting from the config file returning null if not defined.
 java.lang.String getSetting(java.lang.String settingName, java.lang.String def)
          Gets a setting from the config file returning the default value * if not defined.
 java.lang.String getSettingsDirectory()
          Gets the settingsPath attribute of the Settings class * * @return The settingsPath value
 java.lang.String getVersion()
          Gets the version attribute of the Settings object * * @return The version value
 void init()
          Description of the Method * * @exception SettingsException Description of the Exception
 void saveSettings()
          Description of the Method * * @exception SettingsException Description of the Exception
 void setDoubleSetting(java.lang.String settingName, double value)
          Sets the value of an double property.
 void setIntegerSetting(java.lang.String settingName, int value)
          Sets the value of an integer property.
 void setSetting(java.lang.String settingName, java.lang.String settingValue)
          Sets the setting attribute of the Settings object * * @param settingName The new setting value * @param settingValue The new setting value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log

instance

private static Settings instance

settingsDirectoryName

public static java.lang.String settingsDirectoryName

activityLogFileName

public static java.lang.String activityLogFileName

configFileName

public static java.lang.String configFileName

scubaToolkitConfig

private Document scubaToolkitConfig
Constructor Detail

Settings

private Settings()
Constructor for the Settings object

Method Detail

getInstance

public static Settings getInstance()
Gets the instance attribute of the Settings class * * @return The instance value


init

public void init()
          throws SettingsException
Description of the Method * * @exception SettingsException Description of the Exception

SettingsException

getSettingsDirectory

public java.lang.String getSettingsDirectory()
Gets the settingsPath attribute of the Settings class * * @return The settingsPath value


getActivityLogPath

public java.lang.String getActivityLogPath()
Gets the path to the access log file * * @return The path to the access log file


getVersion

public final java.lang.String getVersion()
Gets the version attribute of the Settings object * * @return The version value


getBuildDate

public final java.lang.String getBuildDate()
Gets the buildDate attribute of the Settings object * * @return The buildDate value


getSetting

public final java.lang.String getSetting(java.lang.String settingName)
Gets a setting from the config file returning null if not defined. * * @param settingName The name of the setting to get * @return The setting value


getSetting

public final java.lang.String getSetting(java.lang.String settingName,
                                         java.lang.String def)
Gets a setting from the config file returning the default value * if not defined. * * @param settingName The name of the setting to get * @param def The default to return if setting not defined * @return The setting value or the default


getBooleanSetting

public final boolean getBooleanSetting(java.lang.String settingName)
Returns the value of a boolean property returning false * if not defined. * @param settingName The setting to return.


getBooleanSetting

public final boolean getBooleanSetting(java.lang.String settingName,
                                       boolean def)
Returns the value of a boolean property returning the default value * if not defined. * @param settingName The setting to return. * @param def The default value * @return The setting value or the default


getIntegerSetting

public final int getIntegerSetting(java.lang.String settingName,
                                   int def)
Returns the value of an integer property returning the default value * if not defined. * @param settingName The setting to return. * @param def The default value * @return The setting value or the default


getDoubleSetting

public double getDoubleSetting(java.lang.String settingName,
                               double def)
Returns the value of an double property returning the default value * if not defined. * @param settingName The setting to return. * @param def The default value * @return The setting value or the default


setIntegerSetting

public final void setIntegerSetting(java.lang.String settingName,
                                    int value)
Sets the value of an integer property. * @param settingName The property * @param value The value


setDoubleSetting

public final void setDoubleSetting(java.lang.String settingName,
                                   double value)
Sets the value of an double property. * @param settingName The property * @param value The value


setSetting

public final void setSetting(java.lang.String settingName,
                             java.lang.String settingValue)
Sets the setting attribute of the Settings object * * @param settingName The new setting value * @param settingValue The new setting value


saveSettings

public void saveSettings()
                  throws SettingsException
Description of the Method * * @exception SettingsException Description of the Exception

SettingsException


Copyright © 2002 The Scuba Toolkit Team. All Rights Reserved.