org.LexGrid.util.config.parameter
Class Parameters

java.lang.Object
  extended by org.LexGrid.util.config.parameter.Parameters

public class Parameters
extends java.lang.Object

A base class for all application parameters. The primary purpose behind this class is to enable programmers to define application parameters within the scope of the Java language. The benefits of doing this include: To allow parameter names to be validated at compile time. getProperties(String) approaches introduce the possibility of misspelling and typographical errors that may not be detected until quite late in the development cycle. To utilize the existing documentation mechanisms provided by the Java JDK rather thatn trying to arrive at another alternate mechanism for in-file documentation Parms is a singleton base class, maintaining one centralized repository for parameters - the Hashtable called props. To create a set of properties: 1) Derive a class from this class 2) Include the appropriate loader invocation in the static class constructor 3) Enter each parameter as one of StringParameter, BooleanParameter, IntParameter or EncryptedParameter 4) Retrieve the parameter value via the getValue() function

Author:
Philip Ogren, Dan Armbrust

Field Summary
protected static java.util.ArrayList initClasses
          contains a list of all the Classes that have been passed to the init method
protected static org.apache.log4j.Logger logger
           
protected static java.util.HashMap parameters
          parameters include all the parameters of the classes in the init method
 
Constructor Summary
Parameters()
           
 
Method Summary
static java.util.Properties getProperties()
           
static java.util.Properties getProperties(java.lang.Class newClass)
           
protected static void init(java.lang.Class newClass)
           
static void setValues(java.util.Properties properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

protected static java.util.HashMap parameters
parameters include all the parameters of the classes in the init method


initClasses

protected static java.util.ArrayList initClasses
contains a list of all the Classes that have been passed to the init method


logger

protected static org.apache.log4j.Logger logger
Constructor Detail

Parameters

public Parameters()
Method Detail

init

protected static void init(java.lang.Class newClass)

getProperties

public static java.util.Properties getProperties(java.lang.Class newClass)

getProperties

public static java.util.Properties getProperties()

setValues

public static void setValues(java.util.Properties properties)

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.