JGAP

org.jgap.data.config
Class ConfigFileReader

java.lang.Object
  extended by org.jgap.data.config.ConfigFileReader

public class ConfigFileReader
extends java.lang.Object

This is a Singleton Helper class to read a JGAP config file and provide a simple interface to the config properties.

Since:
2.3

Method Summary
 java.lang.String getValue(java.lang.String a_name)
          Retrieve the value for the property with the name as in param name.
 java.util.List getValues(java.lang.String a_name)
          Retrieve the values for the property with the name as in param name.
static ConfigFileReader instance()
          Method to create and access the Singleton ConfigFileReader instance.
 void setFileName(java.lang.String a_fileName)
          Set the config file to load from.
 void setNS(java.lang.String a_ns)
          Set the namespace for the properties that are being read from the config file at this point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ConfigFileReader instance()
Method to create and access the Singleton ConfigFileReader instance.

Returns:
instance of the ConfigFileReader
Since:
2.3

getValue

public java.lang.String getValue(java.lang.String a_name)
Retrieve the value for the property with the name as in param name.

Parameters:
a_name - name of the property of which the value is required
Returns:
value for the property with the name as in param name, null if property not found
Since:
2.3

getValues

public java.util.List getValues(java.lang.String a_name)
Retrieve the values for the property with the name as in param name.

Parameters:
a_name - the name of the property of which the value is required
Returns:
ArrayList of Strings with values for the property with the name as in param name, null if property not found

setNS

public void setNS(java.lang.String a_ns)
Set the namespace for the properties that are being read from the config file at this point.

Parameters:
a_ns - namespace for the properties being read

setFileName

public void setFileName(java.lang.String a_fileName)
                 throws ConfigException
Set the config file to load from. Everytime this method is called, properties are reloaded from the config file.

Parameters:
a_fileName - Name of the config file.
Throws:
ConfigException
Since:
2.3

JGAP