fhm.edu.fem.util.properties
Class PropertyCache

java.lang.Object
  extended by fhm.edu.fem.util.properties.PropertyCache

public class PropertyCache
extends java.lang.Object

Class Description: This class read it's input from a given properties file and caches the data in a hash map.

Author:
Thomas Woellert (thomas@woellert.net), Stefan Weissbach (weissbst@gmx.de)

Field Summary
protected static boolean isLogging
           
protected  java.util.LinkedHashMap<java.lang.String,java.util.Properties> propertyMap
           
protected static PropertyCache theInstance
           
 
Constructor Summary
protected PropertyCache()
          Construct a new property cache Protected to enforce singleton
 
Method Summary
static PropertyCache getInstance()
          Retrieve the sole instance of this property cache
static java.util.Properties getProperties(java.lang.String fileName)
          Retrieve the properties for the given filename
static java.lang.String getProperty(java.lang.String fileName, java.lang.String key)
          Get the string value from given key over all the cached key-value-pairs inside given file resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isLogging

protected static boolean isLogging

propertyMap

protected java.util.LinkedHashMap<java.lang.String,java.util.Properties> propertyMap

theInstance

protected static PropertyCache theInstance
Constructor Detail

PropertyCache

protected PropertyCache()
Construct a new property cache Protected to enforce singleton

Method Detail

getInstance

public static PropertyCache getInstance()
Retrieve the sole instance of this property cache

Returns:
theInstance

getProperties

public static java.util.Properties getProperties(java.lang.String fileName)
Retrieve the properties for the given filename

Parameters:
fileName, - the filename pointing to the properties file

getProperty

public static final java.lang.String getProperty(java.lang.String fileName,
                                                 java.lang.String key)
Get the string value from given key over all the cached key-value-pairs inside given file resource

Parameters:
filename - The properties file containing the property
key - The key of the property
Returns:
String The stringified property value