| |
|
| java.lang.Object org.castor.util.Configuration
Configuration | final public class Configuration (Code) | | Class to hold Castor configuration properties.
author: Ralf Joachim version: $Revision: 6907 $ $Date: 2006-03-21 12:26:52 -0700 (Tue, 21 Mar 2006) $ since: 1.0 |
Constructor Summary | |
public | Configuration() Create a new Configuration instance loading properties from default location. | public | Configuration(String filename) Create a new Configuration instance loading properties from given location. |
Configuration | public Configuration()(Code) | | Create a new Configuration instance loading properties from default location.
|
Configuration | public Configuration(String filename)(Code) | | Create a new Configuration instance loading properties from given location.
Parameters: filename - Absolute or relative filename of the properties file. |
disposeConfiguration | public static void disposeConfiguration()(Code) | | Dispose the one and only configuration instance.
|
getInstance | public static Configuration getInstance()(Code) | | Get the one and only configuration instance. If not done yet, a new configuration
will be constructed and default properties will be loaded.
The configuration instance. |
getProperties | public Properties getProperties()(Code) | | Get the configured properties.
The configured properties. |
getProperty | public String getProperty(String name, String defaultValue)(Code) | | Get property with given name as string or if property is not available return
the given default string.
Parameters: name - Name of the property. Parameters: defaultValue - Default string to return if property is not available. The configured string property or the default string if property isnot available. |
getProperty | public String[] getProperty(String name)(Code) | | Get property with given name as string array or if property is not available
return an empty string array.
Parameters: name - Name of the property. The string array of configured property. |
getProperty | public int getProperty(String name, int defaultValue)(Code) | | Get property with given name as int value. If property is not available or can
not be interpreted as integer the given default int value will be returned.
Parameters: name - Name of the property. Parameters: defaultValue - Default int value to return if property is not available orcan not be interpreted as integer. The configured int property or the default int value if property isnot available or can not be interpreted as integer. |
getProperty | public boolean getProperty(String name, boolean defaultValue)(Code) | | Get property with given name as boolean value. If property is not available or
does not equal 'true' or 'false' the given default boolean value will be returned.
Parameters: name - Name of the property. Parameters: defaultValue - Default boolean value to return if property is not availableor does not equal 'true' or 'false' The configured boolean property or the default boolean value if propertyis not available or does not equal 'true' or 'false'. |
loadDefaultProperties | public void loadDefaultProperties()(Code) | | Load properties from default location.
|
loadProperties | public void loadProperties(String filename)(Code) | | Load properties from given filename. It first tries to interpret filename as
absolute resource location. If this fails it's assumed that filename should be
interpreted relative to classpath.
Parameters: filename - Absolute or relative filename of the properties file. |
|
|
|