|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.application.api.Configuration
This class provides the core user configuration implementation logic. All fancy handling and registry access occurs behind the scenes.
Field Summary | |
private static ConfigurationHandler |
_config
The only occurance of the configuration handler. |
static org.apache.log4j.Logger |
cat
Deprecated. in 0.15.3 public access - will become private |
static java.lang.String |
FILE_LOADED
Property to indicate configuration load from file |
static java.lang.String |
FILE_SAVED
Property to indicate configuration save to file |
private static Configuration |
SINGLETON
|
static java.lang.String |
URL_LOADED
Property to indicate configuration load from url |
static java.lang.String |
URL_SAVED
Property to indicate configuration save to url |
Constructor Summary | |
private |
Configuration()
Private constructor so it cannot be instantiated. |
Method Summary | |
static void |
addListener(ConfigurationKey key,
java.beans.PropertyChangeListener pcl)
Adds a property change listener.Static for simplicity of use. |
static void |
addListener(java.beans.PropertyChangeListener pcl)
Adds a property change listener. |
static boolean |
getBoolean(ConfigurationKey key)
Returns the boolean value of a configuration property. |
static boolean |
getBoolean(ConfigurationKey key,
boolean defaultValue)
Returns the boolean value of a configuration property. |
static ConfigurationHandler |
getConfigurationHandler()
Returns the instance of the configuration singleton. |
static double |
getDouble(ConfigurationKey key)
Returns the numeric value of a configuration property. |
static double |
getDouble(ConfigurationKey key,
double defaultValue)
Returns the numeric value of a configuration property. |
static ConfigurationFactory |
getFactory()
Returns the configuration factory instance. |
static int |
getInteger(ConfigurationKey key)
Returns the numeric value of a configuration property. |
static int |
getInteger(ConfigurationKey key,
int defaultValue)
Returns the numeric value of a configuration property. |
static java.lang.String |
getString(ConfigurationKey key)
Returns the string value of a configuration property. |
static java.lang.String |
getString(ConfigurationKey key,
java.lang.String defaultValue)
Returns the string value of a configuration property. |
static boolean |
load()
Load the configuration from the default location. |
static boolean |
load(java.io.File file)
Load the configuration from a specified file |
static boolean |
load(java.net.URL url)
Load the configuration from a specified url |
static ConfigurationKey |
makeKey(ConfigurationKey ck,
java.lang.String k1)
Create a sub-component of an existing configuration key. |
static ConfigurationKey |
makeKey(java.lang.String k1)
Create a single component configuration key. |
static ConfigurationKey |
makeKey(java.lang.String k1,
java.lang.String k2)
Create a two-component configuration key. |
static ConfigurationKey |
makeKey(java.lang.String k1,
java.lang.String k2,
java.lang.String k3)
Create a three-component configuration key. |
static ConfigurationKey |
makeKey(java.lang.String k1,
java.lang.String k2,
java.lang.String k3,
java.lang.String k4)
Create a four-component configuration key. |
static ConfigurationKey |
makeKey(java.lang.String k1,
java.lang.String k2,
java.lang.String k3,
java.lang.String k4,
java.lang.String k5)
Create a five-component configuration key. |
static void |
removeListener(ConfigurationKey key,
java.beans.PropertyChangeListener pcl)
Removes a property change listener. |
static void |
removeListener(java.beans.PropertyChangeListener pcl)
Removes a property change listener. |
static boolean |
save()
Save the configuration to the default location. |
static boolean |
save(boolean force)
Save the configuration to the default location. |
static void |
setBoolean(ConfigurationKey key,
boolean newValue)
Sets the boolean value of a configuration property. |
static void |
setDouble(ConfigurationKey key,
double newValue)
Sets the numeric value of a configuration property. |
static void |
setInteger(ConfigurationKey key,
int newValue)
Sets the numeric value of a configuration property. |
static void |
setString(ConfigurationKey key,
java.lang.String newValue)
Sets the string value of a configuration property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.apache.log4j.Logger cat
public static final java.lang.String FILE_LOADED
public static final java.lang.String URL_LOADED
public static final java.lang.String FILE_SAVED
public static final java.lang.String URL_SAVED
private static ConfigurationHandler _config
private static Configuration SINGLETON
Constructor Detail |
private Configuration()
Method Detail |
public static ConfigurationHandler getConfigurationHandler()
public static final ConfigurationFactory getFactory()
public static final boolean load()
public static final boolean load(java.io.File file)
file
- the File to load
public static final boolean load(java.net.URL url)
url
- the URL to load
public static final boolean save()
public static final boolean save(boolean force)
force
- the file to save even if it would not normally
be saved.
public static java.lang.String getString(ConfigurationKey key)
key
- the key to retrieve the value of
public static final java.lang.String getString(ConfigurationKey key, java.lang.String defaultValue)
key
- the key to retrieve the value ofdefaultValue
- the value to return if the key does not exist
public static final int getInteger(ConfigurationKey key)
key
- the key to retrieve the value of
public static final double getDouble(ConfigurationKey key, double defaultValue)
key
- the key to retrieve the value ofdefaultValue
- if the key is not found
public static final double getDouble(ConfigurationKey key)
key
- the key to retrieve the value of
public static final int getInteger(ConfigurationKey key, int defaultValue)
key
- the key to retrieve the value ofdefaultValue
- the value to return if the key does not exist
public static final boolean getBoolean(ConfigurationKey key)
key
- the key to retrieve the value of
public static final boolean getBoolean(ConfigurationKey key, boolean defaultValue)
key
- the key to retrieve the value ofdefaultValue
- the value to return if the key does not exist
public static final void setString(ConfigurationKey key, java.lang.String newValue)
key
- the key to setnewValue
- the value to set the key to.public static final void setInteger(ConfigurationKey key, int newValue)
key
- the key to setnewValue
- the value to set the key to.public static final void setDouble(ConfigurationKey key, double newValue)
key
- the key to setnewValue
- the value to set the key to.public static final void setBoolean(ConfigurationKey key, boolean newValue)
key
- the key to setnewValue
- the value to set the key to.public static final void addListener(java.beans.PropertyChangeListener pcl)
pcl
- The property change listener to addpublic static final void removeListener(java.beans.PropertyChangeListener pcl)
pcl
- The property change listener to removepublic static final void addListener(ConfigurationKey key, java.beans.PropertyChangeListener pcl)
key
- The key to listen for changes ofpcl
- The property change listener to addpublic static final void removeListener(ConfigurationKey key, java.beans.PropertyChangeListener pcl)
key
- The key to listen for changes ofpcl
- The property change listener to removepublic static ConfigurationKey makeKey(java.lang.String k1)
k1
- key component 1.
ConfigurationKey
.public static ConfigurationKey makeKey(ConfigurationKey ck, java.lang.String k1)
ck
- existing key to extend.k1
- key component 1.
ConfigurationKey
.public static ConfigurationKey makeKey(java.lang.String k1, java.lang.String k2)
k1
- key component 1.k2
- key component 2.
ConfigurationKey
.public static ConfigurationKey makeKey(java.lang.String k1, java.lang.String k2, java.lang.String k3)
k1
- key component 1.k2
- key component 2.k3
- key component 3.
ConfigurationKey
.public static ConfigurationKey makeKey(java.lang.String k1, java.lang.String k2, java.lang.String k3, java.lang.String k4)
k1
- key component 1.k2
- key component 2.k3
- key component 3.k4
- key component 4.
ConfigurationKey
.public static ConfigurationKey makeKey(java.lang.String k1, java.lang.String k2, java.lang.String k3, java.lang.String k4, java.lang.String k5)
k1
- key component 1.k2
- key component 2.k3
- key component 3.k4
- key component 4.k5
- key component 5.
ConfigurationKey
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040316) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |