javawrapper::BatchFileParser Class Reference

SAX batch file parse handler. More...

List of all members.

Public Member Functions

 BatchFileParser (BatchSetup oBatchSetup)
 Constructor.
void startElement (java.lang.String sURI, java.lang.String sLocalName, java.lang.String sQName, Attributes oAttributes) throws SAXException
 Function called when an opening tag is encountered.
void characters (char[] p_cCh, int iStart, int iLength) throws SAXException
 Reads character data from the XML file.
void endElement (java.lang.String sURI, java.lang.String sLocalName, java.lang.String sQName) throws SAXException
 Called at the end of an XML tag.

Private Attributes

BatchSetup m_oBatchSetup
 Object to transfer the collected parameter files to.
StringBuffer m_sBuf = new StringBuffer()
 String buffer to collect data in our parser.
String m_sParFile
 Parameter file value.
int m_iNumTimesToRun
 Number of times to run a parameter file.


Detailed Description

SAX batch file parse handler.

Copyright: Copyright (c) Charles D. Canham 2005

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
March 31, 2005: Created (LEM)


Constructor & Destructor Documentation

javawrapper::BatchFileParser::BatchFileParser ( BatchSetup  oBatchSetup  )  [inline]

Constructor.

Parameters:
oBatchSetup BatchSetup object to transfer parameter files to.


Member Function Documentation

void javawrapper::BatchFileParser::characters ( char[]  p_cCh,
int  iStart,
int  iLength 
) throws SAXException [inline]

Reads character data from the XML file.

The data is appended to the string buffer. This is done because, according to the SAX parser specs, it is free to call this function multiple times per tag if it wants. So this function collects the data into a single buffer.

Parameters:
p_cCh The characters from the XML document.
iStart - The start position in the array.
iLength - The number of characters to read from the array.
Exceptions:
SAXException if any of the described cases above is true.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
May 17, 2004: Fixed a bug - put in trimming of spaces when spaces is all there is (LEM)

void javawrapper::BatchFileParser::endElement ( java.lang.String  sURI,
java.lang.String  sLocalName,
java.lang.String  sQName 
) throws SAXException [inline]

Called at the end of an XML tag.

If this is a parameter file name tag, this stashes the value in m_sBuf into m_sParFile. If this is a number-of- times-to-run tag, this converts the value in m_sBuf into an integer and stashes it in m_iNumTimesToRun. If this is the end of a parameter file couplet, then this passes the accumulated data on to the BatchSetup object.

Parameters:
sURI the Namespace URI (ignored)
sLocalName the local name (what this function looks at)
sQName the qualified (prefixed) name (ignored)
Exceptions:
SAXException if there were problems assigning the data.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

void javawrapper::BatchFileParser::startElement ( java.lang.String  sURI,
java.lang.String  sLocalName,
java.lang.String  sQName,
Attributes  oAttributes 
) throws SAXException [inline]

Function called when an opening tag is encountered.

This initializes our StringBuffer to get it ready to hold the tag's character data.

Parameters:
sURI the Namespace URI (ignored)
sLocalName the local name (what this function looks at)
sQName the qualified (prefixed) name (ignored)
oAttributes The tag's attributes
Exceptions:
SAXException if there are any problems.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)


The documentation for this class was generated from the following file:
Generated on Wed Nov 29 08:45:02 2006 for SORTIE Java Interface by  doxygen 1.4.7