jimm.twice.util
Class Props

java.lang.Object
  extended byjimm.twice.util.Props

public class Props
extends java.lang.Object

The single instance of this class can retrieve and return property values.

Author:
Jim Menard, jimm@io.com

Field Summary
protected static java.lang.String DEFAULT_RESOURCE_PREFIX
           
protected  java.util.ResourceBundle props
           
protected static Props propsInstance
           
protected static java.lang.String resourcePrefix
           
protected static java.lang.Object syncLock
           
 
Constructor Summary
protected Props()
          Constructor.
 
Method Summary
 boolean getBooleanProperty(java.lang.String name)
          Returns a boolean property or false if not found.
 java.lang.String getProperty(java.lang.String name)
          Returns the specified property or null if not found.
static Props instance()
          Returns the single instance of this class.
static void setResourcePrefix(java.lang.String prefix)
          Sets the resource prefix (the name used to look up properties).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RESOURCE_PREFIX

protected static final java.lang.String DEFAULT_RESOURCE_PREFIX
See Also:
Constant Field Values

resourcePrefix

protected static java.lang.String resourcePrefix

propsInstance

protected static Props propsInstance

syncLock

protected static java.lang.Object syncLock

props

protected java.util.ResourceBundle props
Constructor Detail

Props

protected Props()
Constructor.

Method Detail

instance

public static Props instance()
Returns the single instance of this class.


setResourcePrefix

public static void setResourcePrefix(java.lang.String prefix)
Sets the resource prefix (the name used to look up properties). The default is fine for normal operation, but during testing we want to be able to use a different resource file.

Parameters:
prefix - the resource prefix

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the specified property or null if not found.

Returns:
the specified property or null if not found

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
Returns a boolean property or false if not found. True values include "y", "yes", "true", or "t" (case insensitive).