com.sun.faban.common
Class ParamReader

java.lang.Object
  extended by com.sun.faban.common.ParamReader

public class ParamReader
extends Object

The ParamReader reads the run parameter file (usually run.xml) and provides the caller with a document node. It is making sure that older parameter file formats get converted to the latest format. This conversion happens in the DOM tree. All access to the parameter file should go through the ParamReader to ensure backwards compatibility.

Author:
Akara Sucharitakul

Field Summary
static String FABANURI
          The base Faban namespace URI.
 
Constructor Summary
ParamReader(String fileName, boolean warnDeprecated)
          Constructs a ParamReader for the given configuration file.
 
Method Summary
 Document getDocument()
          Obtains the Document object for this param file.
 XPath getXPath()
          Obtains the preconfigured XPath object.
static void main(String[] args)
          Invokes the ParamReader in conversion mode and actually saves the conversion output to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FABANURI

public static final String FABANURI
The base Faban namespace URI.

See Also:
Constant Field Values
Constructor Detail

ParamReader

public ParamReader(String fileName,
                   boolean warnDeprecated)
            throws Exception
Constructs a ParamReader for the given configuration file.

Parameters:
fileName - The configuration file
warnDeprecated - Log warnings if config file is deprecated format
Throws:
Exception - If reading this file does not succeed
Method Detail

getDocument

public Document getDocument()
Obtains the Document object for this param file.

Returns:
The Document element of the DOM tree.

getXPath

public XPath getXPath()
Obtains the preconfigured XPath object.

Returns:
The XPath object.

main

public static void main(String[] args)
                 throws Exception
Invokes the ParamReader in conversion mode and actually saves the conversion output to a file.

Parameters:
args - The input and output file
Throws:
Exception - If anything goes wrong with the conversion