Package com.nt.udc.util
Class EnhConfigFileProcessor
java.lang.Object
com.nt.udc.util.EnhConfigFileProcessor
This class is very similar to the existing ConfigFileProcessor class,
except for the few enhancements that allow for easier dealings with
the config file.
Currently, this class provides 2 extra features over the
ConfigFileProcessor:
- Values of a setting are stored as a String[], instead of a String.
This means that for all values, seperated with ",", the stored
form of the value(s) is a String array. This allows easier
use for a single value, and eliminates the requirement to parse
for a value every time.
- Allows simple variable substitution in the configuration file.
This means the user may reference PREVIOUSLY DEFINED configuration
settings in their setting with the following syntax:
$(previous_setting_name)
For example, the result of setting2 is the value of setting1:
setting1 thisvalue
setting2 $(setting1)
Multiple references work as well:
setting1 thisvalue
setting2 $(setting1)
setting3 $(setting2)
If an undefined setting is referenced, the resulting value will
be null.
-
Constructor Summary
ConstructorsConstructorDescriptionEnhConfigFileProcessor
(String filename) Give the file processor the given file name to process. -
Method Summary
Modifier and TypeMethodDescriptionReturns the mapping between the keys and values.static String
stringArrayToString
(String[] array) This method converts the given String[] object to a comma-delimeted String object.
-
Constructor Details
-
EnhConfigFileProcessor
Give the file processor the given file name to process.- Parameters:
filename
- File to process- Throws:
IOException
-
-
Method Details
-
getRuleInfo
Returns the mapping between the keys and values. Please note that the values returned from the HashMap are String[], not String.- Returns:
- key-value mapping from configuration file
-
stringArrayToString
This method converts the given String[] object to a comma-delimeted String object.- Parameters:
array
- Array to convert- Returns:
- comma-delimited String
-