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
-
_defaultName
-
-
_defaultPath
-
-
configFileName
-
-
configFilePath
-
-
Configuration()
-
-
changeVal(String, String)
- Allows to change the value of the given configuration field.
-
fieldsList()
- Returns the list of all configuration fields.
-
get(String)
- Get a configuration value.
-
init()
- This methods initialized Configuration by loading the default configuration file.
-
init(String, String)
- This methods initialized Configuration by loading the given configuration file.
-
isEmpty()
- Returns true iff no configuration fields are currently loaded.
-
isInitialised()
- Returns true if configuration data have been initialised.
-
numberOfFields()
- Gives the number of configuration fileds.
-
put(String, String)
- Put a new fieldname with the given value.
-
remove(String)
- Remove a field.
-
removeAll()
- Removes all configuration fields.
-
save()
- Save the internal configuration structure in the current configuration filename.
-
save(String, String)
- Save the internal configuration structure in a file.
-
saveAsDefault()
- Save as a new default configuration file.
_defaultName
public final static String _defaultName
_defaultPath
public final static String _defaultPath
configFileName
protected static String configFileName
configFilePath
protected static String configFilePath
Configuration
public Configuration()
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.
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.
isInitialised
public static boolean isInitialised()
- Returns true if configuration data have been initialised.
- Returns:
- true iff configuration has been initialised.
isEmpty
public static boolean isEmpty()
- Returns true iff no configuration fields are currently loaded.
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
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
saveAsDefault
public static void saveAsDefault() throws ConfigurationException
- Save as a new default configuration file.
- Returns:
- none.
- Throws: ConfigurationException
- when a problem occured.
get
public static String get(String fieldName)
- Get a configuration value.
- Parameters:
- fieldName - of the configuration value.
- Returns:
- the value.
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.
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.
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.
fieldsList
public static Enumeration fieldsList()
- Returns the list of all configuration fields.
- Returns:
- an enumeration of the fields.
numberOfFields
public static int numberOfFields()
- Gives the number of configuration fileds.
- Returns:
- s the number.
removeAll
public static void removeAll()
- Removes all configuration fields.
- Returns:
- none.
All Packages Class Hierarchy This Package Previous Next Index