|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jnati.config.Configuration
public class Configuration
Implements a multi-layered configuration. There are three layers of configuration - in order of increasing precedence: defaults, configuration and runtime. Defaults and configured properties can be loaded (from a .properties file) or set (from a Map), while runtime properties are retrieved from System.getProperties().
| Constructor Summary | |
|---|---|
Configuration()
Construct a new configuration with no parameters. |
|
Configuration(Configuration parentConfig,
Map<String,String> params,
Properties configuration)
Construct a new configuration with the specified parent configuration, and parameters. |
|
Configuration(Map<String,String> params)
Construct a new configuration with the specified parameters. |
|
| Method Summary | |
|---|---|
String |
getProperty(String key)
Gets the property's value. |
void |
loadConfiguration(InputStream in)
Load the configured properties. |
void |
loadDefaults(InputStream in)
Load the default property values. |
void |
setConfiguration(Map<String,String> config)
Sets the configured properties. |
void |
setDefaults(Map<String,String> defaults)
Sets the default property values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Configuration()
public Configuration(Map<String,String> params)
params -
public Configuration(Configuration parentConfig,
Map<String,String> params,
Properties configuration)
parentConfig - params - | Method Detail |
|---|
public void loadDefaults(InputStream in)
throws IOException
in -
IOExceptionpublic void setDefaults(Map<String,String> defaults)
defaults -
public void loadConfiguration(InputStream in)
throws IOException
in -
IOExceptionpublic void setConfiguration(Map<String,String> config)
config - public String getProperty(String key)
key -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||