public class SBMLWriter
extends java.lang.Object
Constructor | Description |
---|---|
SBMLWriter() |
|
SBMLWriter(char indentChar,
short indentCount) |
Creates a new
SBMLWriter with the given configuration for the
indentChar and indentCount , i.e., the symbol to be used
to indent elements in the XML representation of SBML data objects and the
number of these symbols to be concatenated at the beginning of each new
line for a new element. |
Modifier and Type | Method | Description |
---|---|---|
static char |
getDefaultIndentChar() |
Returns the default symbol to be used to indent new elements in the XML
representation of SBML data structures.
|
static short |
getDefaultIndentCount() |
Returns the default number of indent symbols to be concatenated at the
beginning of a new block in an XML representation of SBML data
structures.
|
char |
getIndentationChar() |
Gives the symbol that is used to indent the SBML output for a better
structure and to improve human-readability.
|
short |
getIndentationCount() |
Gives the number of indent symbols that are inserted in a line to better structure the SBML output.
|
static void |
main(java.lang.String[] args) |
Tests this class
|
void |
setIndentationChar(char indentSymbol) |
Sets other blank character(s) for indentation.
|
void |
setIndentationCount(int indentCount) |
Sets the indent for this
SBMLWriter . |
void |
setIndentationCount(short indentCount) |
Sets the indent for this
SBMLWriter . |
void |
write(SBMLDocument document,
java.io.File file) |
Writes the
SBMLDocument into a File . |
void |
write(SBMLDocument document,
java.io.File file,
java.lang.String programName,
java.lang.String programVersion) |
Writes the
SBMLDocument into a File . |
void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream) |
Writes the
SBMLDocument into an OutputStream . |
void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream,
java.lang.String programName,
java.lang.String programVersion) |
Writes the XML representation of an
SBMLDocument into an OutputStream . |
void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName) |
Writes the XML representation of an
SBMLDocument in a SBML file. |
void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName,
java.lang.String programName,
java.lang.String programVersion) |
Writes the XML representation of an
SBMLDocument in a SBML file. |
java.lang.String |
writeAnnotation(SBase sbase) |
|
java.lang.String |
writeSBMLToString(SBMLDocument doc) |
Writes the given
SBMLDocument to an in-memory XML String . |
java.lang.String |
writeSBMLToString(SBMLDocument d,
java.lang.String programName,
java.lang.String programVersion) |
Writes the given
SBMLDocument to an in-memory XML String . |
public SBMLWriter()
public SBMLWriter(char indentChar, short indentCount)
SBMLWriter
with the given configuration for the
indentChar
and indentCount
, i.e., the symbol to be used
to indent elements in the XML representation of SBML data objects and the
number of these symbols to be concatenated at the beginning of each new
line for a new element.indentChar
- the symbol to be used to indent elements in the XML representationindentCount
- the number of these symbols to be concatenatedpublic static char getDefaultIndentChar()
public static short getDefaultIndentCount()
public static void main(java.lang.String[] args) throws SBMLException
args
- SBMLException
public char getIndentationChar()
public short getIndentationCount()
public void setIndentationChar(char indentSymbol)
Allowed are
only tabs and white spaces, i.e., '\t'
and ' '
.
indentSymbol
- the character to be used for indentationpublic void setIndentationCount(int indentCount)
SBMLWriter
.indentCount
- the indent count to setsetIndentationCount(short)
public void setIndentationCount(short indentCount)
SBMLWriter
.indentCount
- the indent count to setpublic void write(SBMLDocument document, java.io.File file) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
SBMLDocument
into a File
.document
- the SBMLDocument
to write.file
- the File
to write to.SBMLException
- if any error is detected in the SBMLDocument
.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.java.io.IOException
- if it is not possible to write to the given file, e.g., due
to an invalid file name or missing permissions.public void write(SBMLDocument document, java.io.File file, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
SBMLDocument
into a File
.document
- the SBMLDocument
to write.file
- the File
to write to.programName
- the program name.programVersion
- the program version.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.java.io.IOException
- if it is not possible to write to the given file, e.g., due
to an invalid file name or missing permissions.public void write(SBMLDocument sbmlDocument, java.io.OutputStream stream) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
into an OutputStream
.sbmlDocument
- the SBMLDocument
to write.stream
- a OutputStream
where to write the content of the model to.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.public void write(SBMLDocument sbmlDocument, java.io.OutputStream stream, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
into an OutputStream
.sbmlDocument
- the SBMLDocument
stream
- the OutputStream
to write to.programName
- the program name (can be null).programVersion
- the program version (can be null).javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.public void write(SBMLDocument sbmlDocument, java.lang.String fileName) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
SBMLDocument
in a SBML file.sbmlDocument
- the SBMLDocument
to write.fileName
- the name of the file where to write the SBMLDocument
javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.java.io.IOException
- if an I/O error occurs.public void write(SBMLDocument sbmlDocument, java.lang.String fileName, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
SBMLDocument
in a SBML file.sbmlDocument
- the SBMLDocument
to write.fileName
- the name of the file where to write the SBMLDocument
programName
- the program name that created the SBMLDocument
programVersion
- the program version that created the SBMLDocument
javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.java.io.IOException
- if an I/O error occurs.public java.lang.String writeAnnotation(SBase sbase) throws javax.xml.stream.XMLStreamException
sbase
- the SBase
element.Annotation
of the given SBase
element as an XML String
.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.public java.lang.String writeSBMLToString(SBMLDocument doc) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
to an in-memory XML String
.doc
- the SBMLdocument
SBMLdocument
as a
String.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.public java.lang.String writeSBMLToString(SBMLDocument d, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
to an in-memory XML String
.d
- programName
- programVersion
- SBMLdocument
as a String
.javax.xml.stream.XMLStreamException
- if any error occur while creating the XML document.SBMLException
- if any error is detected in the SBMLDocument
.