Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scubatoolkit
Class Settings  view Settings download Settings.java

java.lang.Object
  extended byorg.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.

Version:
1.0

Field Summary
static java.lang.String activityLogFileName
           
static java.lang.String configFileName
           
private static Settings instance
           
private static org.apache.log4j.Logger log
           
private  org.dom4j.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
 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
 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
 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
 java.lang.String getVersion()
          Gets the version attribute of the Settings object
 void init()
          Description of the Method
 void saveSettings()
          Description of the Method
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.log4j.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 org.dom4j.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


init

public void init()
          throws SettingsException
Description of the Method


getSettingsDirectory

public java.lang.String getSettingsDirectory()
Gets the settingsPath attribute of the Settings class


getActivityLogPath

public java.lang.String getActivityLogPath()
Gets the path to the access log file


getVersion

public final java.lang.String getVersion()
Gets the version attribute of the Settings object


getBuildDate

public final java.lang.String getBuildDate()
Gets the buildDate attribute of the Settings object


getSetting

public final java.lang.String getSetting(java.lang.String settingName)
Gets a setting from the config file returning null if not defined.


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.


getBooleanSetting

public final boolean getBooleanSetting(java.lang.String settingName)
Returns the value of a boolean property returning false if not defined.


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.


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.


getDoubleSetting

public double getDoubleSetting(java.lang.String settingName,
                               double def)
Returns the value of an double property returning the default value if not defined.


setIntegerSetting

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


setDoubleSetting

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


setSetting

public final void setSetting(java.lang.String settingName,
                             java.lang.String settingValue)
Sets the setting attribute of the Settings object


saveSettings

public void saveSettings()
                  throws SettingsException
Description of the Method