|
|||||||||||
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 String |
FILE_LOADED
Property to indicate configuration load from file. |
static String |
FILE_SAVED
Property to indicate configuration save to file. |
static String |
URL_LOADED
Property to indicate configuration load from url. |
static 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,
PropertyChangeListener pcl)
Adds a property change listener.Static for simplicity of use. |
static void |
addListener(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 String |
getString(ConfigurationKey key)
Returns the string value of a configuration property. |
static String |
getString(ConfigurationKey key,
String defaultValue)
Returns the string value of a configuration property. |
static boolean |
load()
Load the configuration from the default location. |
static boolean |
load(File file)
Load the configuration from a specified file. |
static boolean |
load(URL url)
Load the configuration from a specified url. |
static ConfigurationKey |
makeKey(ConfigurationKey ck,
String k1)
Create a sub-component of an existing configuration key. |
static ConfigurationKey |
makeKey(String k1)
Create a single component configuration key. |
static ConfigurationKey |
makeKey(String k1,
String k2)
Create a two-component configuration key. |
static ConfigurationKey |
makeKey(String k1,
String k2,
String k3)
Create a three-component configuration key. |
static ConfigurationKey |
makeKey(String k1,
String k2,
String k3,
String k4)
Create a four-component configuration key. |
static ConfigurationKey |
makeKey(String k1,
String k2,
String k3,
String k4,
String k5)
Create a five-component configuration key. |
static void |
removeListener(ConfigurationKey key,
PropertyChangeListener pcl)
Removes a property change listener. |
static void |
removeListener(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,
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 String FILE_LOADED
public static final String URL_LOADED
public static final String FILE_SAVED
public static final String URL_SAVED
private static ConfigurationHandler config
Constructor Detail |
private Configuration()
Method Detail |
public static ConfigurationHandler getConfigurationHandler()
public static final ConfigurationFactory getFactory()
This is equivalent to ConfigurationFactory.getInstance() but using Configuration.getFactory() is shorter to type and allows us not to have to deal with ConfigurationFactory at all if we don't need to modify or configure it.
public static final boolean load()
public static final boolean load(File file)
file
- the File to load
public static final boolean load(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 String getString(ConfigurationKey key)
key
- the key to retrieve the value of
public static final String getString(ConfigurationKey key, 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, 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(PropertyChangeListener pcl)
pcl
- The property change listener to addpublic static final void removeListener(PropertyChangeListener pcl)
pcl
- The property change listener to removepublic static final void addListener(ConfigurationKey key, PropertyChangeListener pcl)
key
- The key to listen for changes ofpcl
- The property change listener to addpublic static final void removeListener(ConfigurationKey key, PropertyChangeListener pcl)
key
- The key to listen for changes ofpcl
- The property change listener to removepublic static ConfigurationKey makeKey(String k1)
k1
- key component 1.
ConfigurationKey
.public static ConfigurationKey makeKey(ConfigurationKey ck, String k1)
ck
- existing key to extend.k1
- key component 1.
ConfigurationKey
.public static ConfigurationKey makeKey(String k1, String k2)
k1
- key component 1.k2
- key component 2.
ConfigurationKey
.public static ConfigurationKey makeKey(String k1, String k2, String k3)
k1
- key component 1.k2
- key component 2.k3
- key component 3.
ConfigurationKey
.public static ConfigurationKey makeKey(String k1, String k2, String k3, String k4)
k1
- key component 1.k2
- key component 2.k3
- key component 3.k4
- key component 4.
ConfigurationKey
.public static ConfigurationKey makeKey(String k1, String k2, String k3, String k4, 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 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |