org.castor.util
public final class Configuration extends Object
Since: 1.0
Version: $Revision: 6320 $ $Date: 2006-03-21 12:26:52 -0700 (Tue, 21 Mar 2006) $
Constructor Summary | |
---|---|
Configuration()
Create a new Configuration instance loading properties from default location. | |
Configuration(String filename)
Create a new Configuration instance loading properties from given location.
|
Method Summary | |
---|---|
static void | disposeConfiguration()
Dispose the one and only configuration instance. |
static Configuration | getInstance()
Get the one and only configuration instance. |
Properties | getProperties()
Get the configured properties.
|
String | getProperty(String name, String defaultValue)
Get property with given name as string or if property is not available return
the given default string.
|
String[] | getProperty(String name)
Get property with given name as string array or if property is not available
return an empty string array.
|
int | getProperty(String name, int defaultValue)
Get property with given name as int value. |
boolean | getProperty(String name, boolean defaultValue)
Get property with given name as boolean value. |
void | loadDefaultProperties()
Load properties from default location. |
void | loadProperties(String filename)
Load properties from given filename. |
Parameters: filename Absolute or relative filename of the properties file.
Returns: The configuration instance.
Returns: The configured properties.
Parameters: name Name of the property. defaultValue Default string to return if property is not available.
Returns: The configured string property or the default string if property is not available.
Parameters: name Name of the property.
Returns: The string array of configured property.
Parameters: name Name of the property. defaultValue Default int value to return if property is not available or can not be interpreted as integer.
Returns: The configured int property or the default int value if property is not available or can not be interpreted as integer.
Parameters: name Name of the property. defaultValue Default boolean value to return if property is not available or does not equal 'true' or 'false'
Returns: The configured boolean property or the default boolean value if property is not available or does not equal 'true' or 'false'.
Parameters: filename Absolute or relative filename of the properties file.