datavisualizer::DetailedOutputFileSetupParseHandler Class Reference

Plugs into the Xerces SAX parser to handle the incoming data when the detailed output setup XML file is parsed. More...

List of all members.

Public Member Functions

 DetailedOutputFileSetupParseHandler (DetailedOutputFileManager oManager)
 Constructor.
void startElement (java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes attributes) throws SAXException
 Called when the parser hits a new opening tag.
void characters (char[] ch, int start, int length) 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

DetailedOutputFileManager m_oManager
 Detailed output file manager which owns this parser.
javawrapper.DetailedTreeSettings m_oTreeSettings
 Set of tree settings into which to put data.
javawrapper.DetailedGridSettings m_oGridSettings
 Set of grid settings into which to put data.
StringBuffer m_sBuf = new StringBuffer()
 String buffer to collect data in our parser.
boolean m_bIsFloat
 Indicates the data just parsed is a float data member.
boolean m_bIsInt
 Indicates the data just parsed is an int data member.
boolean m_bIsChar
 Indicates the data just parsed is a char data member.
boolean m_bIsBool
 Indicates the data just parsed is a bool data member.
boolean m_bIsPackage
 Indicates that these are grid package values.
boolean m_bIsTimesteps
 Indicates the data just parsed is the number of timesteps.
boolean m_bIsXPlotLength
 Indicates the data just parsed is the plot X length.
boolean m_bIsYPlotLength
 Indicates the data just parsed is the plot Y length.
boolean m_bIsNumYearsPerTimestep
 Indicates the data just parsed is the number of years per timestep.


Detailed Description

Plugs into the Xerces SAX parser to handle the incoming data when the detailed output setup XML file is parsed.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

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


Constructor & Destructor Documentation

datavisualizer::DetailedOutputFileSetupParseHandler::DetailedOutputFileSetupParseHandler DetailedOutputFileManager  oManager  )  [inline]
 

Constructor.

This is passed an object into which to put the parsed data.

Parameters:
oManager The DetailedOutputFileViewer object into which the data goes.

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


Member Function Documentation

void datavisualizer::DetailedOutputFileSetupParseHandler::characters char[]  ch,
int  start,
int  length
throws SAXException [inline]
 

Reads character data from the XML file.

Whether or not the data is ignored, and what is done with it if it is not ignored, depends on flags that have been set.

If m_bIsFloat is true, AddNewFloat() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsInt is true, AddNewInt() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsChar is true, AddNewChar() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsBool is true, AddNewFloat() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsTimesteps is true, the number of timesteps is sent to m_oManager.

After execution any flag turned on is turned back off.

Parameters:
ch The characters from the XML document.
start - The start position in the array.
length - 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)

void datavisualizer::DetailedOutputFileSetupParseHandler::endElement java.lang.String  sURI,
java.lang.String  sLocalName,
java.lang.String  sQName
throws SAXException [inline]
 

Called at the end of an XML tag.

Whether or not the data is ignored, and what is done with it if it is not ignored, depends on flags that have been set.

If m_bIsFloat is true, AddNewFloat() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsInt is true, AddNewInt() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsChar is true, AddNewChar() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsBool is true, AddNewFloat() is called for m_oTreeSettings. If mp_oTreeMapSettings is null, an error is thrown.

If m_bIsTimesteps is true, the number of timesteps is sent to m_oManager.

After execution any flag turned on is turned back off.

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)
March 21, 2005: Fixed a bug so that package members could be differentiated (LEM)

void datavisualizer::DetailedOutputFileSetupParseHandler::startElement java.lang.String  uri,
java.lang.String  localName,
java.lang.String  qName,
Attributes  attributes
throws SAXException [inline]
 

Called when the parser hits a new opening tag.

This is overridden from the base class. This function is only interested in the following tags:

  • ou_treeInfo - the DetailedOutputFileManager is used to create a new DetailedTreeSettings object. The object is then stashed in m_oTreeSettings.
  • ou_float - m_bIsFloat is set to true.
  • ou_int - m_bIsInt is set to true.
  • ou_char - m_bIsChar is set to true.
  • ou_bool - m_bIsBool is set to true.
  • tr_species - the species name is passed to m_oManager.
  • timesteps - m_bIsTimesteps is set to true.
  • plot_lenX - m_bIsXPlotLength is set to true.
  • plot_lenY - m_bIsYPlotLength is set to true.
  • ou_gridInfo - the DetailedOutputFileManager is used to create a new DetailedGridSettings object. The object is then stashed in m_oGridSettings.
  • Something starting with "ma_package" - m_bIsPackage is set to true.
Parameters:
uri the Namespace URI (ignored)
localName the local name (what this function looks at)
qName the qualified (prefixed) name (ignored)
attributes The tag's attributes
Exceptions:
SAXException if there are any problems.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
March 21, 2005: Fixed a bug so that package members could be differentiated (LEM)


The documentation for this class was generated from the following file:
Generated on Mon Mar 27 15:15:25 2006 for SORTIE Java Interface by  doxygen 1.4.6-NO