org.jboss.dtf.testframework.utils
Class ParameterPreprocessor

java.lang.Object
  extended by org.jboss.dtf.testframework.utils.ParameterPreprocessor

public class ParameterPreprocessor
extends java.lang.Object

A preprocessor for parameters. Takes a list of preprocessor name value pairs then processes string and replaces the $(NAME) variable for the value. e.g. Name: 'DIRECTORY' | Value 'C:/TMP' Name: 'FILENAME' | Value 'FILENAME.TXT' '$(DIRECTORY)/$(FILENAME)' preproccesed would be 'C:/TMP/FILENAME.TXT'


Constructor Summary
ParameterPreprocessor()
           
 
Method Summary
static void addReplacement(java.lang.String text, java.lang.String replace)
          Add a replacement to the replacements map.
static void addReplacements(java.util.Hashtable t)
           
static void clear()
           
static java.lang.String preprocessParameters(java.util.Hashtable sets, java.lang.String text, boolean eraseVars)
           
static java.lang.String preprocessParameters(java.lang.String text)
           
static java.lang.String[] preprocessParameters(java.lang.String[] text)
           
static java.lang.String[] preprocessParameters(java.lang.String[] text, boolean eraseVars)
           
static java.lang.String preprocessParameters(java.lang.String text, boolean eraseVars)
          Search for all $(****) variables and replace them with the correct information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterPreprocessor

public ParameterPreprocessor()
Method Detail

clear

public static final void clear()

addReplacements

public static final void addReplacements(java.util.Hashtable t)

addReplacement

public static final void addReplacement(java.lang.String text,
                                        java.lang.String replace)
Add a replacement to the replacements map.

Parameters:
text - The name of the replacement name/value pair.
replace - The value of the replacement name/value pair.

preprocessParameters

public static final java.lang.String preprocessParameters(java.lang.String text)

preprocessParameters

public static final java.lang.String[] preprocessParameters(java.lang.String[] text)

preprocessParameters

public static final java.lang.String[] preprocessParameters(java.lang.String[] text,
                                                            boolean eraseVars)

preprocessParameters

public static java.lang.String preprocessParameters(java.lang.String text,
                                                    boolean eraseVars)
Search for all $(****) variables and replace them with the correct information

Parameters:
text - The text to preprocess.
Returns:
The preprocessed text.

preprocessParameters

public static java.lang.String preprocessParameters(java.util.Hashtable sets,
                                                    java.lang.String text,
                                                    boolean eraseVars)