java.io.Serializable
, java.lang.Cloneable
public class TidySBMLWriter extends SBMLWriter implements java.lang.Cloneable, java.io.Serializable
This class is just a wrapper for the actual implementation. It does use JTidy, a HTML/XML syntax checker and pretty printer, in order to have a proper XML indentation when writing the SBML document.
Constructor | Description |
---|---|
TidySBMLWriter() |
Creates a new
TidySBMLWriter . |
TidySBMLWriter(char indentChar,
short indentCount) |
Creates a new
TidySBMLWriter that uses the given character for
indentation of the XML representation of SBML data structures (with the
given number of such symbols). |
TidySBMLWriter(java.lang.String programName,
java.lang.String programVersion) |
Creates a new
SBMLWriter for the program with the given name and
version. |
TidySBMLWriter(java.lang.String programName,
java.lang.String programVersion,
char indentChar,
short indentCount) |
Creates a new
SBMLWriter for the program with the given name and
version that uses the given character for indentation of the XML
representation of SBML data structures (with the given number of such
symbols). |
TidySBMLWriter(TidySBMLWriter sbmlWriter) |
Clone constructor.
|
Modifier and Type | Method | Description |
---|---|---|
TidySBMLWriter |
clone() |
|
org.w3c.tidy.Tidy |
getUserTidy() |
Returns the instance of
Tidy that is used to pretty print the SBML. |
static void |
main(java.lang.String[] args) |
|
static void |
setIndentation(char indentChar,
short indentCount) |
|
void |
setUserTidy(org.w3c.tidy.Tidy userTidy) |
Sets the instance of
Tidy that will be used to pretty print the SBML. |
void |
write(SBMLDocument sbmlDocument,
java.io.File file) |
Writes the given SBML document to a
File . |
static void |
write(SBMLDocument sbmlDocument,
java.io.File file,
char indentChar,
short indentCount) |
Writes the given SBML document to a
File . |
static void |
write(SBMLDocument sbmlDocument,
java.io.File file,
java.lang.String programName,
java.lang.String programVersion) |
Writes the given SBML document to a
File . |
static void |
write(SBMLDocument sbmlDocument,
java.io.File file,
java.lang.String programName,
java.lang.String programVersion,
char indentChar,
short indentCount) |
Writes the given SBML document to a
File . |
void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream) |
Writes the given SBML document to the
OutputStream . |
static void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream,
char indentChar,
short indentCount) |
Writes the given
SBMLDocument to the OutputStream . |
static void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream,
java.lang.String programName,
java.lang.String programVersion) |
Writes the given
SBMLDocument to the OutputStream . |
static void |
write(SBMLDocument sbmlDocument,
java.io.OutputStream stream,
java.lang.String programName,
java.lang.String programVersion,
char indentChar,
short indentCount) |
Writes the given
SBMLDocument to the OutputStream . |
void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName) |
Writes the given
SBMLDocument to file name. |
static void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName,
char indentChar,
short indentCount) |
Writes the given
SBMLDocument to file name. |
static void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName,
java.lang.String programName,
java.lang.String programVersion) |
Writes the given
SBMLDocument to file name. |
static void |
write(SBMLDocument sbmlDocument,
java.lang.String fileName,
java.lang.String programName,
java.lang.String programVersion,
char indentChar,
short indentCount) |
Writes the given
SBMLDocument to file name. |
void |
writeSBML(SBMLDocument sbmlDocument,
java.io.File file) |
Writes the given SBML document to a
File . |
void |
writeSBMLToFile(SBMLDocument sbmlDocument,
java.lang.String fileName) |
Writes the given SBML document to file name.
|
java.lang.String |
writeSBMLToString(SBMLDocument sbmlDocument) |
Writes the given SBML document to an in-memory
String and returns
it. |
getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, getIndentationChar, getIndentationCount, getProgramName, getProgramVersion, isSetProgramName, isSetProgramVersion, setIndentationChar, setIndentationCount, setProgramName, setProgramVersion, toString, unsetProgramName, unsetProgramVersion
public TidySBMLWriter()
TidySBMLWriter
.public TidySBMLWriter(char indentChar, short indentCount)
TidySBMLWriter
that uses the given character for
indentation of the XML representation of SBML data structures (with the
given number of such symbols).indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.public TidySBMLWriter(TidySBMLWriter sbmlWriter)
sbmlWriter
- public TidySBMLWriter(java.lang.String programName, java.lang.String programVersion)
SBMLWriter
for the program with the given name and
version.programName
- The name of the program that has been used to create an SBML
String
representation (possibly in a File
)
with the help of JSBML.programVersion
- The version of the program using JSBML to serialize a model in
an SBML String
or File
.public TidySBMLWriter(java.lang.String programName, java.lang.String programVersion, char indentChar, short indentCount)
SBMLWriter
for the program with the given name and
version that uses the given character for indentation of the XML
representation of SBML data structures (with the given number of such
symbols).programName
- The name of the program that has been used to create an SBML
String
representation (possibly in a File
)
with the help of JSBML.programVersion
- The version of the program using JSBML to serialize a model in
an SBML String
or File
.indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.public static void write(SBMLDocument sbmlDocument, java.io.File file, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
File
.sbmlDocument
- the SBMLDocument
to be writtenfile
- the file where the SBML document is to be written.indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write 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 static void setIndentation(char indentChar, short indentCount)
indentChar
- indentCount
- public static void write(SBMLDocument sbmlDocument, java.io.File file, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
File
.
sbmlDocument
- the SBMLDocument
to be writtenfile
- the file where the SBML document is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write 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 static void write(SBMLDocument sbmlDocument, java.io.File file, java.lang.String programName, java.lang.String programVersion, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
File
.
sbmlDocument
- the SBMLDocument
to be writtenfile
- the file where the SBML document is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write 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.write(SBMLDocument, File, String, String)
public static void write(SBMLDocument sbmlDocument, java.io.OutputStream stream, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
to the OutputStream
.sbmlDocument
- the SBML document to be writtenstream
- the stream object where the SBML is to be written.indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public static void write(SBMLDocument sbmlDocument, java.io.OutputStream stream, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
to the OutputStream
.sbmlDocument
- the SBML document to be writtenstream
- the stream object where the SBML is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public static void write(SBMLDocument sbmlDocument, java.io.OutputStream stream, java.lang.String programName, java.lang.String programVersion, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, SBMLException
SBMLDocument
to the OutputStream
.sbmlDocument
- the SBML document to be writtenstream
- the stream object where the SBML is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.write(SBMLDocument, OutputStream, String, String)
public static void write(SBMLDocument sbmlDocument, java.lang.String fileName, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, java.io.FileNotFoundException, SBMLException
SBMLDocument
to file name.sbmlDocument
- the SBMLDocument
to be writtenfileName
- the name or full pathname of the file where the SBML document
is to be written.indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.java.io.FileNotFoundException
- if the file does not exist or cannot be created.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public static void write(SBMLDocument sbmlDocument, java.lang.String fileName, java.lang.String programName, java.lang.String programVersion) throws javax.xml.stream.XMLStreamException, java.io.FileNotFoundException, SBMLException
SBMLDocument
to file name.
sbmlDocument
- the SBMLDocument
to be writtenfileName
- the name or full pathname of the file where the SBML document
is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)java.io.FileNotFoundException
- if the file does not exist or cannot be created.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public static void write(SBMLDocument sbmlDocument, java.lang.String fileName, java.lang.String programName, java.lang.String programVersion, char indentChar, short indentCount) throws javax.xml.stream.XMLStreamException, java.io.FileNotFoundException, SBMLException
SBMLDocument
to file name.
sbmlDocument
- the SBMLDocument
to be writtenfileName
- the name or full pathname of the file where the SBML document
is to be written.programName
- the name of this program (where 'this program' refers to the
program in which JSBML is embedded, not JSBML itself!)programVersion
- the version of this program (where 'this program' refers to
the program in which JSBML is embedded, not JSBML itself!)indentChar
- The symbol to be used to indent new blocks within an XML
representation of SBML data structures.indentCount
- The number of indentation characters.java.io.FileNotFoundException
- if the file does not exist or cannot be created.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.write(SBMLDocument, String, String, String)
public TidySBMLWriter clone()
clone
in class SBMLWriter
public void write(SBMLDocument sbmlDocument, java.io.File file) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
File
. If specified in the
constructor of this SBMLWriter
, the SBMLWriter.programName
and
SBMLWriter.programVersion
of the calling program will be made persistent in
the resulting SBML File
.write
in class SBMLWriter
sbmlDocument
- the SBMLDocument
to be writtenfile
- the file where the SBML document is to be written.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write 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
OutputStream
. If specified
in the constructor of this SBMLWriter
, the SBMLWriter.programName
and SBMLWriter.programVersion
of the calling program will be made
persistent in the resulting SBML representation.write
in class SBMLWriter
sbmlDocument
- the SBML document to be writtenstream
- the stream object where the SBML is to be written.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public void write(SBMLDocument sbmlDocument, java.lang.String fileName) throws javax.xml.stream.XMLStreamException, java.io.FileNotFoundException, SBMLException
SBMLDocument
to file name. If specified in the
constructor of this SBMLWriter
, the SBMLWriter.programName
and
SBMLWriter.programVersion
of the calling program will be made persistent in
the resulting SBML File
.
write
in class SBMLWriter
sbmlDocument
- the SBMLDocument
to be writtenfileName
- the name or full pathname of the file where the SBML document
is to be written.
java.io.FileNotFoundException
- if the file does not exist or cannot be created.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public void writeSBML(SBMLDocument sbmlDocument, java.io.File file) throws javax.xml.stream.XMLStreamException, SBMLException, java.io.IOException
File
. If specified in the
constructor of this SBMLWriter
, the SBMLWriter.programName
and
SBMLWriter.programVersion
of the calling program will be made persistent in
the resulting SBML File
.writeSBML
in class SBMLWriter
sbmlDocument
- the SBML document to be writtenfile
- the file where the SBML document is to be written.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write 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 writeSBMLToFile(SBMLDocument sbmlDocument, java.lang.String fileName) throws java.io.FileNotFoundException, javax.xml.stream.XMLStreamException, SBMLException
SBMLWriter
, the SBMLWriter.programName
and
SBMLWriter.programVersion
of the calling program will be made persistent in
the resulting SBML File
.
writeSBMLToFile
in class SBMLWriter
sbmlDocument
- the SBML document to be writtenfileName
- the name or full pathname of the file where the SBML document
is to be written.java.io.FileNotFoundException
- if the file does not exist or cannot be created.javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public java.lang.String writeSBMLToString(SBMLDocument sbmlDocument) throws javax.xml.stream.XMLStreamException, SBMLException
String
and returns
it. If specified in the constructor of this SBMLWriter
, the
SBMLWriter.programName
and SBMLWriter.programVersion
of the calling program
will be made persistent in the resulting SBML String
.
writeSBMLToString
in class SBMLWriter
sbmlDocument
- the SBML document to be written
javax.xml.stream.XMLStreamException
- if any problems prevent to write the SBMLDocument
as
XML.SBMLException
- if any SBML problems prevent to write the
SBMLDocument
.public org.w3c.tidy.Tidy getUserTidy()
Tidy
that is used to pretty print the SBML.public void setUserTidy(org.w3c.tidy.Tidy userTidy)
Tidy
that will be used to pretty print the SBML.userTidy
- the Tidy
instance to setpublic static void main(java.lang.String[] args) throws SBMLException, javax.xml.stream.XMLStreamException, java.io.IOException
args
- SBMLException
javax.xml.stream.XMLStreamException
java.io.IOException