manipulator
Class Converter

java.lang.Object
  extended by manipulator.Converter

public class Converter
extends java.lang.Object

Converter class for exporting the XML structure into objects.

Author:
Samuel Croset

Field Summary
private  core.XMLBurger burger
           
private  java.lang.String outputPath
           
private  pid.PID pid
           
 
Constructor Summary
Converter(java.lang.String pathToXml)
          Construction of the converter from the XML file of the PID.
Converter(java.lang.String pathToXml, java.lang.String pathToOutputFile)
          Construction of the converter and outputting the serialised objects.
Converter(java.net.URL pidUrl, java.lang.String pathToOutputFile)
          Preferred constructor.
 
Method Summary
 core.XMLBurger getBurger()
           
 java.lang.String getOutputPath()
           
 pid.PID getPid()
           
static void main(java.lang.String[] args)
           
private  void parseInteractions(pid.Model model)
          Parse the interactions
private  void parseMolecules(pid.Model model)
          Parse the molecule bit.
private  void parseOntology()
          Parse the "Ontology" section.
private  void parsePathways(pid.Model model)
          Parse the pathway section
(package private)  void save()
          Save the created objects in ".pid" file.
 void setBurger(core.XMLBurger burger)
           
 void setOutputPath(java.lang.String outputPath)
           
 void setPid(pid.PID pid)
           
 void start()
          Start the parsing of the document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

burger

private core.XMLBurger burger

pid

private pid.PID pid

outputPath

private java.lang.String outputPath
Constructor Detail

Converter

public Converter(java.lang.String pathToXml)
Construction of the converter from the XML file of the PID.

Parameters:
pathToXml -

Converter

public Converter(java.lang.String pathToXml,
                 java.lang.String pathToOutputFile)
Construction of the converter and outputting the serialised objects.

Parameters:
pathToXml -
pathToOutputFile -

Converter

public Converter(java.net.URL pidUrl,
                 java.lang.String pathToOutputFile)
          throws java.io.IOException
Preferred constructor. Constructor downloading the file from the online repository, doing the conversion and outputting the results.

Parameters:
pidUrl -
pathToOutputFile -
Throws:
java.io.IOException
Method Detail

setOutputPath

public void setOutputPath(java.lang.String outputPath)

getOutputPath

public java.lang.String getOutputPath()

setBurger

public void setBurger(core.XMLBurger burger)

getBurger

public core.XMLBurger getBurger()
Returns:
the XMLBurger object used to parse the XML

setPid

public void setPid(pid.PID pid)

getPid

public pid.PID getPid()
Returns:
the PID object in the current state. The parsing that have already happened define the content of the returned PID element

main

public static void main(java.lang.String[] args)
                 throws javax.xml.stream.XMLStreamException,
                        javax.xml.stream.FactoryConfigurationError,
                        java.io.IOException
Throws:
javax.xml.stream.XMLStreamException
javax.xml.stream.FactoryConfigurationError
java.io.IOException

save

void save()
    throws java.io.IOException
Save the created objects in ".pid" file.

Throws:
java.io.IOException

start

public void start()
           throws javax.xml.stream.XMLStreamException
Start the parsing of the document

Throws:
javax.xml.stream.XMLStreamException

parsePathways

private void parsePathways(pid.Model model)
Parse the pathway section

Parameters:
model -

parseInteractions

private void parseInteractions(pid.Model model)
                        throws javax.xml.stream.XMLStreamException
Parse the interactions

Parameters:
model -
Throws:
javax.xml.stream.XMLStreamException

parseMolecules

private void parseMolecules(pid.Model model)
                     throws java.lang.NumberFormatException,
                            javax.xml.stream.XMLStreamException
Parse the molecule bit.

Parameters:
model -
Throws:
javax.xml.stream.XMLStreamException
java.lang.NumberFormatException

parseOntology

private void parseOntology()
                    throws java.lang.NumberFormatException,
                           javax.xml.stream.XMLStreamException
Parse the "Ontology" section.

Throws:
javax.xml.stream.XMLStreamException
java.lang.NumberFormatException