exe
Class XMLParameterParser

java.lang.Object
  extended by exe.XMLParameterParser

public class XMLParameterParser
extends java.lang.Object

This class contains static methods designed to parse the user's inputs from an XML input generator file. Consult the individual method descriptions to to see how each method stores the user's inputs.

Author:
Andrew Jungwirth

Constructor Summary
XMLParameterParser()
           
 
Method Summary
static java.lang.String[] parseToArray(java.lang.String inputXML, int start)
          Parses the user's input into a an array of Strings.
static java.util.Hashtable parseToHash(java.lang.String inputXML)
          Parses the user's inputs into a Hashtable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParameterParser

public XMLParameterParser()
Method Detail

parseToArray

public static java.lang.String[] parseToArray(java.lang.String inputXML,
                                              int start)
                                       throws java.io.IOException
Parses the user's input into a an array of Strings. The user's inputs are added to the array in the same order in which they appear in the XML input generator file starting at the index specified by start. The array indices before start are filled with empty String values so that the calling program can fill them with other parameters that it sends to the script-producing program.

Parameters:
inputXML - A String indicating the file from which the XML input generator should be read. Note that this should be the same String that the server places in argument 2 when running the program to start generating a showfile.
start - The index in the array in which the first user input should be placed. All array elements before this position are filled with empty String values.
Returns:
Gives an array of String objects containing the user's inputs to the input generator in the same order as the input fields appear in the XML input generator file. The array elements less than the value passed to start contain empty Strings to allow the calling program to insert additional parameters.
Throws:
java.io.IOException - Indicates a problem in processing the XML file. In theory, this should never happen because the file has already been parsed by the client before it reaches the server.

parseToHash

public static java.util.Hashtable parseToHash(java.lang.String inputXML)
                                       throws java.io.IOException
Parses the user's inputs into a Hashtable. The keys used to hash the inputs are the Strings from the corresponding <label_line> elements. As an example, this method is used in beamsearch.beamsearch.java.

Parameters:
inputXML - A String indicating the file from which the XML input generator should be read. Note that this should be the same String that the server places in argument 2 when running the program to start generating a showfile.
Returns:
Gives a Hashtable containing the user's inputs to the XML input generator. The hash keys are the String values from the <label_line> elements that correspond to each user input.
Throws:
java.io.IOException - Indicates a problem in processing the XML file. In theory, this should never happen because the file has already been parsed by the client before it reaches the server.