Class Configuration

java.lang.Object
org.castor.ddlgen.Configuration
Direct Known Subclasses:
DDLGenConfiguration

public class Configuration extends Object
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 Details

  • Constructor Details

    • Configuration

      public Configuration()
      Constructor for Configuration.
  • Method Details

    • getBoolValue

      public final boolean getBoolValue(String key) throws WrongFormatException, KeyNotFoundException
      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 error
      KeyNotFoundException - key error
    • getBoolValue

      public final boolean getBoolValue(String key, boolean defaultValue)
      get boolean value associated with key in the configuration files.
      Parameters:
      key - key
      defaultValue - default value
      Returns:
      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.
      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

      public final String getStringValue(String key) throws KeyNotFoundException
      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

      public final String getStringValue(String key, String defaultValue)
      get String value associated with key in the configuration files.
      Parameters:
      key - key
      defaultValue - default value
      Returns:
      return value associated with key. If not exists, return default value
    • addProperties

      public final void addProperties(Properties props)
      add properties (key, value) for configuration, the existed item will be overwrited.
      Parameters:
      props - properties
    • addProperties

      public final void addProperties(String filename) throws GeneratorException
      add properties (key, value) for configuration, the existed item will be overwrited.
      Parameters:
      filename - a properties file
      Throws:
      GeneratorException - generator error
    • setProperty

      public final void setProperty(String key, String value)
      set property value, this will overwrite the loaded value.
      Parameters:
      key - key
      value - value