org.argouml.application.configuration
Class ConfigurationProperties

java.lang.Object
  extended byorg.argouml.application.configuration.ConfigurationHandler
      extended byorg.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
private  boolean canComplain
          Flag to ensure that only the first load failure is reported even though we keep trying because the file or URL may only be temporarily unavailable.
private static Logger LOG
          Logger.
private  Properties propertyBundle
          The primary property bundle.
private static String propertyLocation
          The location of Argo's default properties resource.
 
Fields inherited from class org.argouml.application.configuration.ConfigurationHandler
 
Constructor Summary
ConfigurationProperties()
          Anonymous constructor.
 
Method Summary
 String getDefaultPath()
          Returns the default path for user properties.
 String getValue(String key, String defaultValue)
          Returns the string value of a configuration property.
 boolean loadFile(File file)
          Load the configuration from a specified location.
 boolean loadURL(URL url)
          Load the configuration from a specified location.
(package private)  boolean saveFile(File file)
          Save the configuration to a specified location.
(package private)  boolean saveURL(URL url)
          Save the configuration to a specified location.
 void setValue(String key, 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, loadUnspecified, removeListener, removeListener, save, save, saveDefault, saveDefault, saveUnspecified, setBoolean, setDouble, setInteger, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Logger.


propertyLocation

private static String propertyLocation
The location of Argo's default properties resource.


propertyBundle

private Properties propertyBundle
The primary property bundle.


canComplain

private boolean canComplain
Flag to ensure that only the first load failure is reported even though we keep trying because the file or URL may only be temporarily unavailable.

Constructor Detail

ConfigurationProperties

public ConfigurationProperties()
Anonymous constructor.

Method Detail

getDefaultPath

public String getDefaultPath()
Returns the default path for user properties.

Specified by:
getDefaultPath in class ConfigurationHandler
Returns:
a generic path string.

loadFile

public boolean loadFile(File file)
Load the configuration from a specified location.

Specified by:
loadFile in class ConfigurationHandler
Parameters:
file - the path to load the configuration from.
Returns:
true if the load was successful, false if not.

saveFile

boolean saveFile(File file)
Save the configuration to a specified location.

Specified by:
saveFile in class ConfigurationHandler
Parameters:
file - the path to save the configuration at.
Returns:
true if the save was successful, false if not.

loadURL

public boolean loadURL(URL url)
Load the configuration from a specified location.

Specified by:
loadURL in class ConfigurationHandler
Parameters:
url - the path to load the configuration from.
Returns:
true if the load was successful, false if not.

saveURL

boolean saveURL(URL url)
Save the configuration to a specified location.

Specified by:
saveURL in class ConfigurationHandler
Parameters:
url - the path to save the configuration at.
Returns:
true if the save was successful, false if not.

getValue

public String getValue(String key,
                       String defaultValue)
Returns the string value of a configuration property.

Specified by:
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(String key,
                     String value)
Sets the string value of a configuration property.

Specified by:
setValue in class ConfigurationHandler
Parameters:
key - the key to set.
value - the value to set the key to.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook