Inherits org::xml::sax::helpers::DefaultHandler.
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. |
Copyright: Copyright (c) Charles D. Canham 2005
Company: Institute of Ecosystem Studies
javawrapper.BatchFileParser.BatchFileParser | ( | BatchSetup | oBatchSetup | ) |
void javawrapper.BatchFileParser.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.
This initializes our StringBuffer to get it ready to hold the tag's character data.
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 |
SAXException | if there are any problems. |
void javawrapper.BatchFileParser.characters | ( | char[] | p_cCh, | |
int | iStart, | |||
int | iLength | |||
) | throws SAXException |
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.
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. |
SAXException | if any of the described cases above is true. |
void javawrapper.BatchFileParser.endElement | ( | java.lang.String | sURI, | |
java.lang.String | sLocalName, | |||
java.lang.String | sQName | |||
) | throws SAXException |
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.
sURI | the Namespace URI (ignored) | |
sLocalName | the local name (what this function looks at) | |
sQName | the qualified (prefixed) name (ignored) |
SAXException | if there were problems assigning the data. |
Object to transfer the collected parameter files to.
StringBuffer javawrapper.BatchFileParser.m_sBuf = new StringBuffer() [private] |
String buffer to collect data in our parser.
String javawrapper.BatchFileParser.m_sParFile [private] |
Parameter file value.
int javawrapper.BatchFileParser.m_iNumTimesToRun [private] |
Number of times to run a parameter file.