com.ibm.dse.tools.workbench.base
Class Settings

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--com.ibm.dse.tools.workbench.base.Settings

public class Settings
extends java.util.Hashtable

This class is used to manage different settings It's used to create, modify and select settings.

See Also:
Serialized Form

Field Summary
static int DATABASE
          Database type
protected  java.lang.String dataSourceLocation
          the location of the data source
static int FILE
          File type
static java.lang.String NullConstant
          The null constant
static java.lang.String orderKey
          The order key
static int RESOURCE
          Resource type
 
Constructor Summary
Settings()
          Creates a Settings object.
 
Method Summary
 void flush()
          This method saves the current settings values to the data source
 java.lang.String getProperty(java.lang.String key)
          This method returns the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
 java.lang.String getProperty(java.lang.String group, java.lang.String key)
          This method returns the value of the given group's property
 java.util.Hashtable getSettingsGroup(java.lang.String groupName)
          This method returns a hashtable with the settings of the given group
 java.util.Hashtable getSettingsGroupValues(java.lang.String groupName)
          This method returns a hashtable with the settings values of the given group
protected  void initialize()
          This method initializes the Settings using the given data source
 void removeProperty(java.lang.String key)
          This method removes the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
 void removeProperty(java.lang.String group, java.lang.String key)
          This method deletes a property
 void removeSettingsGroupValues(java.lang.String group)
          This method removes all the properties of the given group
 void setDataSource(java.lang.String name, int type)
          This method initializes the Settings using the given data source
 void setProperty(java.lang.String key, java.lang.String value)
          This method adds or updates the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
 void setProperty(java.lang.String group, java.lang.String key, java.lang.String value)
          This method adds or updates the value of a given property of a given group
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dataSourceLocation

protected java.lang.String dataSourceLocation
the location of the data source

RESOURCE

public static final int RESOURCE
Resource type

FILE

public static final int FILE
File type

DATABASE

public static final int DATABASE
Database type

orderKey

public static final java.lang.String orderKey
The order key

NullConstant

public static final java.lang.String NullConstant
The null constant
Constructor Detail

Settings

public Settings()
Creates a Settings object.
Method Detail

flush

public void flush()
           throws WBInvalidArgumentException,
                  WBInputOutputException
This method saves the current settings values to the data source
Throws:
WBInvalidArgumentException -  
WBInputOutputException -  

getProperty

public java.lang.String getProperty(java.lang.String key)
This method returns the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
Parameters:
key - java.lang.Object The key
Returns:
java.lang.Object The value

getProperty

public java.lang.String getProperty(java.lang.String group,
                                    java.lang.String key)
This method returns the value of the given group's property
Parameters:
group - java.lang.String The group
key - java.lang.String The key
Returns:
java.lang.String

getSettingsGroup

public java.util.Hashtable getSettingsGroup(java.lang.String groupName)
This method returns a hashtable with the settings of the given group
Parameters:
groupName - java.lang.String
Returns:
java.util.Hashtable

getSettingsGroupValues

public java.util.Hashtable getSettingsGroupValues(java.lang.String groupName)
This method returns a hashtable with the settings values of the given group
Parameters:
groupName - java.lang.String
Returns:
java.util.Hashtable

initialize

protected void initialize()
                   throws WBInputOutputException
This method initializes the Settings using the given data source

removeProperty

public void removeProperty(java.lang.String key)
This method removes the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
Parameters:
key - java.lang.Object The key

removeProperty

public void removeProperty(java.lang.String group,
                           java.lang.String key)
This method deletes a property
Parameters:
group - java.lang.String
key - java.lang.String

removeSettingsGroupValues

public void removeSettingsGroupValues(java.lang.String group)
This method removes all the properties of the given group
Parameters:
group - java.lang.String The settings group

setDataSource

public void setDataSource(java.lang.String name,
                          int type)
                   throws WBInputOutputException
This method initializes the Settings using the given data source
Parameters:
name - java.lang.String The data source location
type - int The data source type
Throws:
WBInputOutputException -  

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
This method adds or updates the value of a given property If the property belongs to a group, then it's necessary to use the "group.property" notation
Parameters:
key - java.lang.String
value - java.lang.String

setProperty

public void setProperty(java.lang.String group,
                        java.lang.String key,
                        java.lang.String value)
This method adds or updates the value of a given property of a given group
Parameters:
group - java.lang.String
key - java.lang.String
value - java.lang.String