org.simBio.sim.dm
Class ProtocolParser

java.lang.Object
  extended by org.simBio.sim.dm.ProtocolParser

public class ProtocolParser
extends Object

Protocol XML-file parser.

Version:
$Id: ProtocolParser.java,v 1.2 2007/11/07 04:57:06 mikaelwing Exp $
Author:
Mikael Wing

Field Summary
protected  Document protocol
           
 
Constructor Summary
ProtocolParser(Document protocolXML)
           
ProtocolParser(InputStream protocol)
           
 
Method Summary
 String getBaseModel()
          Read tag attribute "path" from file protocol.
 File getCsvRootFile()
          Get CSV-file.
 org.w3c.dom.traversal.NodeIterator getEraser()
          Read tag from file protocol.
 Node getExchanger()
          Read tag from file protocol.
 String getGenerateModel()
          Read tag attribute "path" from file protocol.
 String getIdentification()
          Read tag attribute "identification" from file protocol.
 org.w3c.dom.traversal.NodeIterator getInserter()
          Read tag from file protocol.
 org.w3c.dom.traversal.NodeIterator getInserterBefore()
          Read tag from file protocol.
 String getLauncher()
          Read tag attribute "launch" from file protocol.
 int getMaxThreads()
          Read tag attribute "threads" from file protocol.
 org.w3c.dom.traversal.NodeIterator getMultiplier()
          Read tag from file protocol.
 Node getNormalizeTo()
          Read tag attribute "xpath" from file protocol.
 InputStream getProtocolAsStream()
          Get protocol as stream.
 String getSettings()
          Read tag attribute "settings" from file protocol.
 String getTocXML()
          Get Toc XML-file path.
 org.w3c.dom.traversal.NodeIterator getWriter()
          Read tag from file protocol.
 File getXmlRootDir()
          Get XML root dir.
 org.w3c.dom.traversal.NodeIterator getXpath(String xpath)
          Read input parameter xpath from file protocol.
 boolean hasExchanger()
          Check if the protocol file has an exchanger or not.
 void setXmlRootDir()
          Add XML root dir (if exist) to XML-file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol

protected Document protocol
Constructor Detail

ProtocolParser

public ProtocolParser(InputStream protocol)
Parameters:
protocol - as InputStream

ProtocolParser

public ProtocolParser(Document protocolXML)
Parameters:
protocolXML - as Document
Method Detail

getProtocolAsStream

public InputStream getProtocolAsStream()
Get protocol as stream.

Returns:
protocol as stream.

getBaseModel

public String getBaseModel()
                    throws IOException
Read tag attribute "path" from file protocol.

Returns:
nodevalue for path.
Throws:
IOException

getGenerateModel

public String getGenerateModel()
                        throws IOException
Read tag attribute "path" from file protocol.

Returns:
nodevalue for path.
Throws:
IOException

getMaxThreads

public int getMaxThreads()
Read tag attribute "threads" from file protocol.

Returns:
Max number of threads or 1 if not defined.

getLauncher

public String getLauncher()
                   throws IOException
Read tag attribute "launch" from file protocol.

Returns:
nodevalue for launch.
Throws:
IOException

getEraser

public org.w3c.dom.traversal.NodeIterator getEraser()
                                             throws IOException
Read tag from file protocol.

Returns:
nodeIterator for eraser.
Throws:
IOException

getInserter

public org.w3c.dom.traversal.NodeIterator getInserter()
                                               throws IOException
Read tag from file protocol.

Returns:
nodeIterator for inserter.
Throws:
IOException

getInserterBefore

public org.w3c.dom.traversal.NodeIterator getInserterBefore()
                                                     throws IOException
Read tag from file protocol.

Returns:
nodeIterator for insert/before.
Throws:
IOException

getWriter

public org.w3c.dom.traversal.NodeIterator getWriter()
                                             throws IOException
Read tag from file protocol.

Returns:
nodeIterator for writer.
Throws:
IOException

getMultiplier

public org.w3c.dom.traversal.NodeIterator getMultiplier()
                                                 throws IOException
Read tag from file protocol.

Returns:
nodeIterator for write/multiplier.
Throws:
IOException

hasExchanger

public boolean hasExchanger()
Check if the protocol file has an exchanger or not.

Returns:
true, when the file has at least one exchanger.

getExchanger

public Node getExchanger()
                  throws IOException
Read tag from file protocol.

Returns:
node for exchanger.
Throws:
IOException

getIdentification

public String getIdentification()
                         throws IOException
Read tag attribute "identification" from file protocol.

Returns:
nodevalue for identification.
Throws:
IOException

getXmlRootDir

public File getXmlRootDir()
                   throws IOException
Get XML root dir.

Returns:
file path for XML.
Throws:
IOException

setXmlRootDir

public void setXmlRootDir()
Add XML root dir (if exist) to XML-file path. This will give the following path: //


getCsvRootFile

public File getCsvRootFile()
                    throws IOException
Get CSV-file.

Returns:
CSV-file.
Throws:
IOException

getTocXML

public String getTocXML()
                 throws IOException
Get Toc XML-file path.

Returns:
Toc XML-file path.
Throws:
IOException

getSettings

public String getSettings()
                   throws IOException
Read tag attribute "settings" from file protocol.

Returns:
nodevalue for settings.
Throws:
IOException

getXpath

public org.w3c.dom.traversal.NodeIterator getXpath(String xpath)
                                            throws IOException
Read input parameter xpath from file protocol.

Parameters:
xpath - string
Returns:
nodeIterator for xpath.
Throws:
IOException

getNormalizeTo

public Node getNormalizeTo()
                    throws IOException
Read tag attribute "xpath" from file protocol.

Returns:
node for xpath.
Throws:
IOException


Copyright © 2005 Cell/Biodinamics simulation project. All Rights Reserved.