SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.conf
Class Configurations

java.lang.Object
  |
  +--com.solarmetric.rd.conf.Configurations

public class Configurations
extends java.lang.Object

Utility methods dealing with configuration.


Constructor Summary
Configurations()
           
 
Method Summary
static void configureInstance(java.lang.Object obj, java.lang.String properties)
          Configures the given object with the given properties by matching the properties string to the object's setter methods.
static java.lang.Object createInstance(java.lang.String clsName, java.lang.String properties, java.lang.ClassLoader loader)
          Creates an instance of the given class and configures it with the given properties.
static java.io.File getFile(java.lang.String name, java.lang.ClassLoader loader)
          Check the given string for a matching file.
static java.lang.Object lookup(java.lang.String name)
          Looks up the given name in JNDI.
static serp.util.Options parseOptions(java.lang.String properties)
          Parse a set of properties from a space-delimited string.
static void populateConfiguration(com.solarmetric.rd.conf.Configuration conf, serp.util.Options opts)
          Set the given Configuration instance from the command line options provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurations

public Configurations()
Method Detail

createInstance

public static java.lang.Object createInstance(java.lang.String clsName,
                                              java.lang.String properties,
                                              java.lang.ClassLoader loader)
Creates an instance of the given class and configures it with the given properties. Property settings should be in the form "prop1=val1 prop2=val2 ...". If the given class is null, null is returned. If the given properties are null, no configuration is performed.

Parameters:
clsName - the name of the class to instantiate; the class must have a default constructor
properties - values for the setter methods of the class
loader - the class loader to use, or null to use the context loader of the current thread
Throws:
java.lang.RuntimeException - on creation error

configureInstance

public static void configureInstance(java.lang.Object obj,
                                     java.lang.String properties)
Configures the given object with the given properties by matching the properties string to the object's setter methods. The properties string should be in the form "prop1=val1 prop2=val2 ...".

Throws:
java.lang.RuntimeException - on configuration error

parseOptions

public static serp.util.Options parseOptions(java.lang.String properties)
Parse a set of properties from a space-delimited string.


populateConfiguration

public static void populateConfiguration(com.solarmetric.rd.conf.Configuration conf,
                                         serp.util.Options opts)
Set the given Configuration instance from the command line options provided. All property names of the given configuration are recognized; additionally, if a properties or p argument exists, the Properties instance it points to will be loaded and set into the given configuration instance. It can point to either a file or a resource name.


getFile

public static java.io.File getFile(java.lang.String name,
                                   java.lang.ClassLoader loader)
Check the given string for a matching file. The string is first tested to see if it is an existing file path. If it does not represent an existing file, it is checked as a resource name of a file. If no resource exists, then it is interpreted as a path to a file that does not exist yet.

Parameters:
name - the file path or resource name
loader - a class loader to use in resource lookup, or null to use the thread's context loader

lookup

public static java.lang.Object lookup(java.lang.String name)
Looks up the given name in JNDI. If the name is null, null is returned.


SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.