|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.util.Configuration
public final class Configuration
Class to hold Castor configuration properties.
Constructor Summary | |
---|---|
Configuration()
Create a new Configuration instance loading properties from default location. |
|
Configuration(java.lang.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. |
java.util.Properties |
getProperties()
Get the configured properties. |
java.lang.String[] |
getProperty(java.lang.String name)
Get property with given name as string array or if property is not available return an empty string array. |
boolean |
getProperty(java.lang.String name,
boolean defaultValue)
Get property with given name as boolean value. |
int |
getProperty(java.lang.String name,
int defaultValue)
Get property with given name as int value. |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Get property with given name as string or if property is not available return the given default string. |
void |
loadDefaultProperties()
Load properties from default location. |
void |
loadProperties(java.lang.String filename)
Load properties from given filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Configuration()
public Configuration(java.lang.String filename)
filename
- Absolute or relative filename of the properties file.Method Detail |
---|
public static Configuration getInstance()
public static void disposeConfiguration()
public void loadDefaultProperties()
public void loadProperties(java.lang.String filename)
filename
- Absolute or relative filename of the properties file.public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
name
- Name of the property.defaultValue
- Default string to return if property is not available.
public java.lang.String[] getProperty(java.lang.String name)
name
- Name of the property.
public int getProperty(java.lang.String name, int defaultValue)
name
- Name of the property.defaultValue
- Default int value to return if property is not available or
can not be interpreted as integer.
public boolean getProperty(java.lang.String name, boolean defaultValue)
name
- Name of the property.defaultValue
- Default boolean value to return if property is not available
or does not equal 'true' or 'false'
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |