common-util

local.tomas.util.configuration
Class ConfigurationUtils

java.lang.Object
  extended by local.tomas.util.configuration.ConfigurationUtils

public final class ConfigurationUtils
extends Object

Configuration utilities.

Author:
tomas.teubner

Method Summary
static Properties asProperties(org.apache.commons.configuration.Configuration configuration)
          Convert configuration to properties.
static Object createConfiguredObject(org.apache.commons.configuration.Configuration conf)
          Create a object configured from a configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

asProperties

public static Properties asProperties(org.apache.commons.configuration.Configuration configuration)
Convert configuration to properties. Each key of the configuration is used as the name of a property.

Parameters:
configuration - the configuration
Returns:
the properties

createConfiguredObject

public static Object createConfiguredObject(org.apache.commons.configuration.Configuration conf)
                                     throws FactoryException
Create a object configured from a configuration. The root node of the configuration must have an attribute class=... specifying the fully qualified class name of the object. The object's class must have a constructor with a single Configuration argument.

Parameters:
conf - the configuration
Returns:
the configured bean
Throws:
FactoryException - on object creation failures

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.