edu.uconn.mcb.lineageevolver.parsing
Class LECParser

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.parsing.LECParser

public class LECParser
extends java.lang.Object

Parser for the XML-formatted ELECT output files.

Author:
Hasan Khalil

Field Summary
(package private)  javax.xml.parsers.DocumentBuilder _parser
          The actual parser used to parse the XML document.
 
Constructor Summary
LECParser()
          Defualt constructor for objects of type LECParser.
 
Method Summary
static void main(java.lang.String[] args)
          Test driver.
 Configuration parseFile(java.lang.String fileName)
          Parses an ELECT-generated XML file, yeilding a filled Configuration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parser

javax.xml.parsers.DocumentBuilder _parser
The actual parser used to parse the XML document.

Constructor Detail

LECParser

public LECParser()
          throws javax.xml.parsers.ParserConfigurationException
Defualt constructor for objects of type LECParser. Generates all of the generic parser-oriented objects, and configures them to be ready for XML parsing.

Throws:
javax.xml.parsers.ParserConfigurationException - If there was an error with the backend XML parser.
Method Detail

parseFile

public Configuration parseFile(java.lang.String fileName)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               javax.xml.parsers.ParserConfigurationException
Parses an ELECT-generated XML file, yeilding a filled Configuration object. Uses the SAX2 XML parsing back-end to do all the dirty-work.

Parameters:
fileName - The filename of the XML file to parse.
Returns:
a Configuration containing the information from the provided XML file.
Throws:
java.io.IOException - If there was a problem with file I/O.
org.xml.sax.SAXException - If there was a problem with the XML parser backend.
javax.xml.parsers.ParserConfigurationException - If there was a problem obtaining a proper XML parser.

main

public static void main(java.lang.String[] args)
Test driver. Attempts to parse the file specified by the first argument and outputs the root genome found.

Parameters:
args - should be an array containing one item: the path to the file to be parsed.