public class Configuration extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FALSE
String representation of boolean
false . |
static String |
TRUE
String representation of boolean
true . |
Constructor and Description |
---|
Configuration()
Constructor for Configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperties(Properties props)
add properties (key, value) for configuration, the existed item will
be overwrited.
|
void |
addProperties(String filename)
add properties (key, value) for configuration, the existed item will
be overwrited.
|
boolean |
getBoolValue(String key)
get boolean value associated with key in the configuration files.
|
boolean |
getBoolValue(String key,
boolean defaultValue)
get boolean value associated with key in the configuration files.
|
Integer |
getInteger(String name)
Get property with given name as Integer value.
|
String |
getStringValue(String key)
get String value associated with key in the configuration files.
|
String |
getStringValue(String key,
String defaultValue)
get String value associated with key in the configuration files.
|
void |
setProperty(String key,
String value)
set property value, this will overwrite the loaded value.
|
public static final String TRUE
true
.public static final String FALSE
false
.public final boolean getBoolValue(String key) throws WrongFormatException, KeyNotFoundException
key
- keyWrongFormatException
- format errorKeyNotFoundException
- key errorpublic final boolean getBoolValue(String key, boolean defaultValue)
key
- keydefaultValue
- default valuepublic final Integer getInteger(String name)
name
- Name of the property.public final String getStringValue(String key) throws KeyNotFoundException
key
- keyKeyNotFoundException
- key errorpublic final String getStringValue(String key, String defaultValue)
key
- keydefaultValue
- default valuepublic final void addProperties(Properties props)
props
- propertiespublic final void addProperties(String filename) throws GeneratorException
filename
- a properties fileGeneratorException
- generator errorCopyright © 2013. All rights reserved.