Package org.castor.ddlgen
Class Configuration
java.lang.Object
org.castor.ddlgen.Configuration
- Direct Known Subclasses:
DDLGenConfiguration
Handle the configuration for DDL generator including load configuration files,
manage configuration values.
- Since:
- 1.1
- Version:
- $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Le Duc Bao, Ralf Joachim
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addProperties
(String filename) add properties (key, value) for configuration, the existed item will be overwrited.final void
addProperties
(Properties props) add properties (key, value) for configuration, the existed item will be overwrited.final boolean
getBoolValue
(String key) get boolean value associated with key in the configuration files.final boolean
getBoolValue
(String key, boolean defaultValue) get boolean value associated with key in the configuration files.final Integer
getInteger
(String name) Get property with given name as Integer value.final String
getStringValue
(String key) get String value associated with key in the configuration files.final String
getStringValue
(String key, String defaultValue) get String value associated with key in the configuration files.final void
setProperty
(String key, String value) set property value, this will overwrite the loaded value.
-
Field Details
-
TRUE
String representation of booleantrue
.- See Also:
-
FALSE
String representation of booleanfalse
.- See Also:
-
-
Constructor Details
-
Configuration
public Configuration()Constructor for Configuration.
-
-
Method Details
-
getBoolValue
get boolean value associated with key in the configuration files.- Parameters:
key
- key- Returns:
- return value associated with key. If not exists, throw an exception
- Throws:
WrongFormatException
- format errorKeyNotFoundException
- key error
-
getBoolValue
get boolean value associated with key in the configuration files.- Parameters:
key
- keydefaultValue
- default value- Returns:
- return value associated with key. If not exists, return the default value
-
getInteger
Get property with given name as Integer value. If property is not available or can not be interpreted as integer null will be returned.- Parameters:
name
- Name of the property.- Returns:
- The configured Integer property or null if property is not available or can not be interpreted as integer.
-
getStringValue
get String value associated with key in the configuration files.- Parameters:
key
- key- Returns:
- return value associated with key. If not exists, throw an exception
- Throws:
KeyNotFoundException
- key error
-
getStringValue
get String value associated with key in the configuration files.- Parameters:
key
- keydefaultValue
- default value- Returns:
- return value associated with key. If not exists, return default value
-
addProperties
add properties (key, value) for configuration, the existed item will be overwrited.- Parameters:
props
- properties
-
addProperties
add properties (key, value) for configuration, the existed item will be overwrited.- Parameters:
filename
- a properties file- Throws:
GeneratorException
- generator error
-
setProperty
set property value, this will overwrite the loaded value.- Parameters:
key
- keyvalue
- value
-