junit.extensions.conf
Class ConfigurationFactory

java.lang.Object
  |
  +--junit.extensions.conf.ConfigurationFactory

public class ConfigurationFactory
extends java.lang.Object

Factory for creating configurations.

Author:
Siegfried GOESCHL, Dima STADNIK

Field Summary
protected  LoadableConfiguration conf
          Configuration created by factory.
static java.lang.String[] DEFAULT_PATH_LIST
          Defaults for finding the configuration files
static java.lang.String EXTENSION
          Extension of configuration files.
protected static ConfigurationFactory factory
          The only instance of configuration factory.
static java.lang.String HINT
          Property key that defines configuration file or path to configuration files.
static java.lang.String LOADER
          Property key that defines loadable configuration implementation class name.
 
Method Summary
 Configuration getConfiguration()
          Returns current configuration.
protected  LoadableConfiguration getConfiguration(java.lang.String[] path, java.lang.String fileName)
          Factory method for instantiating and populating configuration.
static ConfigurationFactory getFactory()
          Returns factory instance.
protected  java.lang.String getFileName(java.lang.Class base)
          Generates configuration file name based on class name.
static void init(java.lang.Class base)
          Explicit initialization of factory.
protected  void load(java.lang.Class base)
          Loads configuration into factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PATH_LIST

public static final java.lang.String[] DEFAULT_PATH_LIST
Defaults for finding the configuration files

LOADER

public static final java.lang.String LOADER
Property key that defines loadable configuration implementation class name.

HINT

public static final java.lang.String HINT
Property key that defines configuration file or path to configuration files.

EXTENSION

public static final java.lang.String EXTENSION
Extension of configuration files.

factory

protected static ConfigurationFactory factory
The only instance of configuration factory.

conf

protected LoadableConfiguration conf
Configuration created by factory.
Method Detail

getFactory

public static ConfigurationFactory getFactory()
Returns factory instance.
Returns:
Factory instance.

getConfiguration

public Configuration getConfiguration()
Returns current configuration.
Returns:
Configuration instance.

init

public static void init(java.lang.Class base)
Explicit initialization of factory.
Parameters:
base - Class that is used as base to find configuration.

load

protected void load(java.lang.Class base)
             throws java.io.IOException
Loads configuration into factory.
Parameters:
base - Class that is used as base to find configuration.

getFileName

protected java.lang.String getFileName(java.lang.Class base)
Generates configuration file name based on class name.
Parameters:
base - Reference class.
Returns:
File name.

getConfiguration

protected LoadableConfiguration getConfiguration(java.lang.String[] path,
                                                 java.lang.String fileName)
                                          throws java.io.IOException
Factory method for instantiating and populating configuration.
Parameters:
path - Search path for configuration files.
fileName - Name of configuration file.


Copyright © 2001-2002 IT20one GmbH. All Rights Reserved.