Class semper.preferences.Configuration
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.preferences.Configuration

java.lang.Object
   |
   +----semper.preferences.Configuration

public class Configuration
extends Object

Variable Index

 o _defaultName
 o _defaultPath
 o configFileName
 o configFilePath

Constructor Index

 o Configuration()

Method Index

 o changeVal(String, String)
Allows to change the value of the given configuration field.
 o fieldsList()
Returns the list of all configuration fields.
 o get(String)
Get a configuration value.
 o init()
This methods initialized Configuration by loading the default configuration file.
 o init(String, String)
This methods initialized Configuration by loading the given configuration file.
 o isEmpty()
Returns true iff no configuration fields are currently loaded.
 o isInitialised()
Returns true if configuration data have been initialised.
 o numberOfFields()
Gives the number of configuration fileds.
 o put(String, String)
Put a new fieldname with the given value.
 o remove(String)
Remove a field.
 o removeAll()
Removes all configuration fields.
 o save()
Save the internal configuration structure in the current configuration filename.
 o save(String, String)
Save the internal configuration structure in a file.
 o saveAsDefault()
Save as a new default configuration file.

Variables

 o _defaultName
  public final static String _defaultName
 o _defaultPath
  public final static String _defaultPath
 o configFileName
  protected static String configFileName
 o configFilePath
  protected static String configFilePath

Constructors

 o Configuration
  public Configuration()

Methods

 o init
  public static void init() throws ConfigurationException
This methods initialized Configuration by loading the default configuration file.
Returns:
none.
Throws: ConfigurationException
when the file is not found.
 o init
  public static void init(String path,
                          String fileName) throws ConfigurationException
This methods initialized Configuration by loading the given configuration file.
Parameters:
the - path for the file to retrieve
the - filename to retrieve.
Returns:
none.
Throws: ConfigurationException
when the file is not found.
 o isInitialised
  public static boolean isInitialised()
Returns true if configuration data have been initialised.
Returns:
true iff configuration has been initialised.
 o isEmpty
  public static boolean isEmpty()
Returns true iff no configuration fields are currently loaded.
 o save
  public static void save(String path,
                          String fileName) throws ConfigurationException
Save the internal configuration structure in a file.
Parameters:
path - is the absolute path where to put the file.
fileName - of the configuration file.
Throws: ConfigurationException
when a problem happened.
See Also:
File
 o save
  public static void save() throws ConfigurationException
Save the internal configuration structure in the current configuration filename. Should be used only when Configuration has been initialised correctly.
Returns:
none.
Throws: ConfigurationException
when the current file and path are not well-defined.
See Also:
File
 o saveAsDefault
  public static void saveAsDefault() throws ConfigurationException
Save as a new default configuration file.
Returns:
none.
Throws: ConfigurationException
when a problem occured.
 o get
  public static String get(String fieldName)
Get a configuration value.
Parameters:
fieldName - of the configuration value.
Returns:
the value.
 o put
  public static String put(String fieldName,
                           String fieldVal)
Put a new fieldname with the given value.
Parameters:
fieldName - is the field identity.
fieldValue - is the value to be put.
Returns:
the old value of the field, or null if it did not have one.
 o changeVal
  public static String changeVal(String fieldName,
                                 String fieldVal)
Allows to change the value of the given configuration field.
Parameters:
fieldName - is the name of the field.
fieldVal - is the new value.
Returns:
the old value or null if the field did not exists before. No modification is done in that case.
 o remove
  public static String remove(String fieldName)
Remove a field.
Parameters:
fieldName - to remove.
Returns:
the field value or null if no field has been found.
 o fieldsList
  public static Enumeration fieldsList()
Returns the list of all configuration fields.
Returns:
an enumeration of the fields.
 o numberOfFields
  public static int numberOfFields()
Gives the number of configuration fileds.
Returns:
s the number.
 o removeAll
  public static void removeAll()
Removes all configuration fields.
Returns:
none.

All Packages  Class Hierarchy  This Package  Previous  Next  Index