org.sbml.jsbml
public class SBMLReader extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
This SBMLReader is just a wrapper for the actual implementation
in SBMLReader.
This class is
provided for compatibility with libSBML and to avoid problems if the
internal of jsbml change, so it is preferable to use it instead of directly
using SBMLReader.
The SBMLReader class provides the main interface for reading SBML
content from files and strings. The methods for reading SBML all return
an SBMLDocument object representing the results.
In the case of failures (such as if the SBML contains errors), the errors
will be recorded with the SBMLErrorLog
object kept in the SBMLDocument returned by SBMLReader.
Consequently, immediately after calling a method on SBMLReader,
callers should always check for errors and warnings using the methods for
this purpose provided by SBMLDocument.
| Modifier and Type | Field and Description |
|---|---|
private static SBMLReader |
reader
The singleton actual reader.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
| Constructor and Description |
|---|
SBMLReader()
Creates a new
SBMLReader. |
SBMLReader(SBMLReader sbmlReader)
Clone constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SBMLReader |
clone() |
boolean |
equals(java.lang.Object o) |
static SBMLDocument |
read(java.io.File file)
Factory method for reading SBML from a given
File. |
static SBMLDocument |
read(java.io.File file,
TreeNodeChangeListener listener)
Factory method for reading SBML from a given
File. |
static SBMLDocument |
read(java.io.InputStream stream)
Factory method for reading SBML from a given
InputStream. |
static SBMLDocument |
read(java.lang.String xml)
Factory method for reading SBML from given XML code in its
String
representation. |
SBMLDocument |
readSBML(java.io.File file)
Reads an SBML document from a
File. |
SBMLDocument |
readSBML(java.io.File file,
TreeNodeChangeListener listener) |
SBMLDocument |
readSBML(java.lang.String fileName)
Reads an SBML document from a file.
|
SBMLDocument |
readSBMLFromFile(java.lang.String filename)
Reads an SBML document from a file.
|
SBMLDocument |
readSBMLFromStream(java.io.InputStream stream)
Reads an SBML document from a data stream.
|
SBMLDocument |
readSBMLFromString(java.lang.String xml)
Reads an SBML document from the given XML string.
|
java.lang.String |
toString() |
private static final long serialVersionUID
private static final SBMLReader reader
public SBMLReader()
SBMLReader.public SBMLReader(SBMLReader sbmlReader)
sbmlReader - public static SBMLDocument read(java.io.File file) throws javax.xml.stream.XMLStreamException, java.io.IOException
File.file - javax.xml.stream.XMLStreamExceptionjava.io.IOException - if the file does not exist or cannot be read.public static SBMLDocument read(java.io.File file, TreeNodeChangeListener listener) throws javax.xml.stream.XMLStreamException, java.io.IOException
File.file - listener - javax.xml.stream.XMLStreamExceptionjava.io.IOException - if the file does not exist or cannot be read.public SBMLDocument readSBML(java.io.File file, TreeNodeChangeListener listener) throws javax.xml.stream.XMLStreamException, java.io.IOException
file - listener - java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic static SBMLDocument read(java.io.InputStream stream) throws javax.xml.stream.XMLStreamException
InputStream.stream - javax.xml.stream.XMLStreamExceptionpublic static SBMLDocument read(java.lang.String xml) throws javax.xml.stream.XMLStreamException
String
representation.xml - javax.xml.stream.XMLStreamExceptionpublic SBMLReader clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic SBMLDocument readSBML(java.io.File file) throws javax.xml.stream.XMLStreamException, java.io.IOException
File.
This method is identical to readSBMLFromFile(String filename)
or readSBML(String filename).
If the File named file does not exist or its content is not
valid SBML, one Exception will be thrown.
This methods is not part of the libSBML SBMLReader API.
file - the file to be read.
SBMLDocument created from the SBML content.javax.xml.stream.XMLStreamException - if any other problems prevent to create a SBMLDocumentjava.io.IOException - if the file does not exist or cannot be read.public SBMLDocument readSBML(java.lang.String fileName) throws javax.xml.stream.XMLStreamException, java.io.IOException
This method is identical to readSBMLFromFile(String filename)
or readSBML(File file).
If the file named filename does not exist or its content is not
valid SBML, one Exception will be thrown.
fileName - the name or full pathname of the file to be read.
SBMLDocument created from the SBML content.javax.xml.stream.XMLStreamException - if any other problems prevent to create a SBMLDocumentjava.io.IOException - if the file does not exist or cannot be read.public SBMLDocument readSBMLFromFile(java.lang.String filename) throws javax.xml.stream.XMLStreamException, java.io.IOException
This method is identical to readSBML(String filename)
or readSBML(File file).
If the file named filename does not exist or its content is not
valid SBML, one Exception will be thrown.
filename - the name or full pathname of the file to be read.
SBMLDocument created from the SBML content.javax.xml.stream.XMLStreamException - if any other problems prevent to create a SBMLDocumentjava.io.IOException - if the file does not exist or cannot be read.public SBMLDocument readSBMLFromStream(java.io.InputStream stream) throws javax.xml.stream.XMLStreamException
This methods is not part of the libSBML SBMLReader API.
stream - the stream of data to be read.
SBMLDocument created from the SBML content.javax.xml.stream.XMLStreamException - if any problems prevent to create a SBMLDocumentpublic SBMLDocument readSBMLFromString(java.lang.String xml) throws javax.xml.stream.XMLStreamException
xml - a string containing a full SBML modelSBMLDocument created from the SBML content.javax.xml.stream.XMLStreamException - if any problems prevent to create a SBMLDocumentpublic java.lang.String toString()
toString in class java.lang.Object