lacam.config
Class Config

java.lang.Object
  extended bylacam.config.Config
Direct Known Subclasses:
DefaultConfig

public class Config
extends java.lang.Object

The systems config.

Author:
Dimitrij Zub

Constructor Summary
Config()
           
 
Method Summary
static boolean getBooleanProperty(java.lang.String key)
           
static java.awt.Color getColorProperty(java.lang.String key)
           
static int getIntProperty(java.lang.String key)
           
static org.w3c.dom.NodeList getPropertiesList(java.lang.String key)
           
static java.lang.String getProperty(java.lang.String key)
           
static java.lang.String getProperty(java.lang.String key, java.lang.String default_value)
           
static org.w3c.dom.Node getPropertyNode(java.lang.String key)
          Return the Node representing the key
static boolean loadConfigDocument()
          Loads the config xml file and applies the default values.
static void saveDocument()
          Saves the config document.
static void setProperty(java.lang.String key, java.lang.String value)
          Same as setProperty(String, String, boolean) with cdata = false
static void setProperty(java.lang.String key, java.lang.String value, boolean cdata)
          Sets the given value for the key and wraps it into a CDATA section if needed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config

public Config()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String default_value)
Parameters:
key - The key to look for
default_value - The default value to return, if nothing found
Returns:
The value found for the key, of the default value.

getProperty

public static java.lang.String getProperty(java.lang.String key)
See Also:
getProperty(String, String)

getIntProperty

public static int getIntProperty(java.lang.String key)
See Also:
getProperty(String)

getBooleanProperty

public static boolean getBooleanProperty(java.lang.String key)
See Also:
getProperty(String)

getColorProperty

public static java.awt.Color getColorProperty(java.lang.String key)
See Also:
getProperty(String)

getPropertiesList

public static org.w3c.dom.NodeList getPropertiesList(java.lang.String key)
Returns:
The NodeList of all child nodes of the node matching the key

getPropertyNode

public static org.w3c.dom.Node getPropertyNode(java.lang.String key)
Return the Node representing the key

See Also:
getPropertiesList(String)

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value,
                               boolean cdata)
Sets the given value for the key and wraps it into a CDATA section if needed

Parameters:
key - The key, where to put the value
value - The value to put
cdata - True if wrapping in CDATA is required

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value)
Same as setProperty(String, String, boolean) with cdata = false

See Also:
setProperty(String, String, boolean)

loadConfigDocument

public static boolean loadConfigDocument()
Loads the config xml file and applies the default values.

Returns:
true if successfull.
See Also:
DefaultConfig

saveDocument

public static void saveDocument()
Saves the config document.