org.castor.ddlgen
Class Configuration
java.lang.Object
org.castor.ddlgen.Configuration
public class Configuration
extends java.lang.Object
Handle the configuration for DDL generator including load configuration files,
manage configuration values.
$Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $static String | FALSE - String representation of boolean
false .
|
static String | TRUE - String representation of boolean
true .
|
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.
|
FALSE
public static final String FALSE
String representation of boolean false
.
TRUE
public static final String TRUE
String representation of boolean true
.
Configuration
public Configuration()
Constructor for Configuration.
addProperties
public final void addProperties(Properties props)
add properties (key, value) for configuration, the existed item will
be overwrited.
addProperties
public final void addProperties(String filename)
throws GeneratorException
add properties (key, value) for configuration, the existed item will
be overwrited.
filename
- a properties file
getBoolValue
public final boolean getBoolValue(String key)
throws WrongFormatException,
KeyNotFoundException
get boolean value associated with key in the configuration files.
- return value associated with key. If not exists, throw an
exception
getBoolValue
public final boolean getBoolValue(String key,
boolean defaultValue)
get boolean value associated with key in the configuration files.
key
- keydefaultValue
- default value
- return value associated with key. If not exists, return the default value
getInteger
public final Integer getInteger(String name)
Get property with given name as Integer value. If property is not
available or can not be interpreted as integer null will be returned.
name
- Name of the property.
- The configured Integer property or null if property is not
available or can not be interpreted as integer.
getStringValue
public final String getStringValue(String key)
throws KeyNotFoundException
get String value associated with key in the configuration files.
- return value associated with key. If not exists, throw an
exception
getStringValue
public final String getStringValue(String key,
String defaultValue)
get String value associated with key in the configuration files.
key
- keydefaultValue
- default value
- return value associated with key. If not exists, return default
value
setProperty
public final void setProperty(String key,
String value)
set property value, this will overwrite the loaded value.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com