org.argouml.application.configuration
Class ConfigurationProperties
java.lang.Object
|
+--org.argouml.application.configuration.ConfigurationHandler
|
+--org.argouml.application.configuration.ConfigurationProperties
- public class ConfigurationProperties
- extends ConfigurationHandler
This class provides a user configuration based upon properties files.
Eventually this configuration file will be
available to users via a GUI interface to
set keyboards
memory allocations
which modules to load
user preferences
font sizes
user names and data
etc.*
Field Summary |
protected java.util.Properties |
_properties
The primary property bundle. |
Method Summary |
java.lang.String |
getDefaultPath()
Returns the default path for user properties. |
java.lang.String |
getValue(java.lang.String key,
java.lang.String defaultValue)
Returns the string value of a configuration property. |
boolean |
loadFile(java.io.File file)
Load the configuration from a specified location. |
boolean |
loadURL(java.net.URL url)
Load the configuration from a specified location. |
void |
setValue(java.lang.String key,
java.lang.String value)
Sets the string value of a configuration property. |
Methods inherited from class org.argouml.application.configuration.ConfigurationHandler |
addListener, addListener, getBoolean, getDouble, getInteger, getString, hasKey, isChangeable, isChanged, isLoaded, load, load, loadDefault, removeListener, removeListener, save, save, saveDefault, saveDefault, setBoolean, setDouble, setInteger, setString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_properties
protected java.util.Properties _properties
- The primary property bundle.
ConfigurationProperties
public ConfigurationProperties()
- Anonymous constructor.
getDefaultPath
public java.lang.String getDefaultPath()
- Returns the default path for user properties.
- Overrides:
getDefaultPath
in class ConfigurationHandler
- Returns:
- a generic path string.
loadFile
public boolean loadFile(java.io.File file)
- Load the configuration from a specified location.
- Parameters:
file
- the path to load the configuration from.- Returns:
- true if the load was successful, false if not.
loadURL
public boolean loadURL(java.net.URL url)
- Load the configuration from a specified location.
- Parameters:
url
- the path to load the configuration from.- Returns:
- true if the load was successful, false if not.
getValue
public java.lang.String getValue(java.lang.String key,
java.lang.String defaultValue)
- Returns the string value of a configuration property.
- Overrides:
getValue
in class ConfigurationHandler
- Parameters:
key
- the key to return the value of.defaultValue
- the value to return if the key was not found.- Returns:
- the string value of the key if found, otherwise null;
setValue
public void setValue(java.lang.String key,
java.lang.String value)
- Sets the string value of a configuration property.
- Parameters:
key
- the key to set.value
- the value to set the key to.