public class XMLOutputStream extends java.lang.Object
Constructor and Description |
---|
XMLOutputStream(OStream stream)
Creates a new
XMLOutputStream that wraps stream. |
XMLOutputStream(OStream stream,
java.lang.String encoding)
Creates a new
XMLOutputStream that wraps stream. |
XMLOutputStream(OStream stream,
java.lang.String encoding,
boolean writeXMLDecl)
Creates a new
XMLOutputStream that wraps stream. |
XMLOutputStream(OStream stream,
java.lang.String encoding,
boolean writeXMLDecl,
java.lang.String programName)
Creates a new
XMLOutputStream that wraps stream. |
XMLOutputStream(OStream stream,
java.lang.String encoding,
boolean writeXMLDecl,
java.lang.String programName,
java.lang.String programVersion)
Creates a new
XMLOutputStream that wraps stream. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Explicitly deletes the underlying native object.
|
void |
downIndent()
Decreases the indentation level for this
XMLOutputStream . |
void |
endElement(java.lang.String name)
Writes the given XML end element name to this
XMLOutputStream . |
void |
endElement(java.lang.String name,
java.lang.String prefix)
Writes the given XML end element name to this
XMLOutputStream . |
void |
endElement(XMLTriple triple)
Writes the given XML end element 'prefix:name' to this
XMLOutputStream . |
boolean |
equals(java.lang.Object sb)
Equality comparison method for XMLOutputStream.
|
SBMLNamespaces |
getSBMLNamespaces()
Returns the
SBMLNamespaces object attached to this XMLInputStream
if it has been set, null otherwise. |
int |
hashCode()
Returns a hashcode for this XMLOutputStream object.
|
void |
setAutoIndent(boolean indent)
Turns automatic indentation on or off for this
XMLOutputStream . |
void |
setSBMLNamespaces(SBMLNamespaces sbmlns)
Sets the
SBMLNamespaces object to allow this stream to reference
the available SBML namespaces being read. |
void |
startElement(java.lang.String name)
Writes the given XML start element name to this
XMLOutputStream . |
void |
startElement(java.lang.String name,
java.lang.String prefix)
Writes the given XML start element name to this
XMLOutputStream . |
void |
startElement(XMLTriple triple)
Writes the given XML start element 'prefix:name' to this
XMLOutputStream . |
void |
startEndElement(java.lang.String name)
Writes the given XML start and end element name to this
XMLOutputStream . |
void |
startEndElement(java.lang.String name,
java.lang.String prefix)
Writes the given XML start and end element name to this
XMLOutputStream . |
void |
startEndElement(XMLTriple triple)
Writes the given XML start and end element 'prefix:name' to this
XMLOutputStream . |
void |
upIndent()
Increases the indentation level for this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
boolean value)
Writes the given attribute, name='true' or name='false' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
double value)
Writes the given attribute, name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
int value)
Writes the given attribute, name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String value)
Writes the given attribute, name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String prefix,
boolean value)
Writes the given attribute, prefix:name='true' or prefix:name='false' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String prefix,
double value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String prefix,
int value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String prefix,
long value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(java.lang.String name,
java.lang.String prefix,
java.lang.String value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(XMLTriple triple,
boolean value)
Writes the given attribute, prefix:name='true' or prefix:name='false'
to this
XMLOutputStream . |
void |
writeAttribute(XMLTriple triple,
double value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(XMLTriple triple,
int value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeAttribute(XMLTriple triple,
java.lang.String value)
Writes the given attribute, prefix:name='value' to this
XMLOutputStream . |
void |
writeComment(java.lang.String programName,
java.lang.String programVersion)
Writes an XML comment:
|
void |
writeXMLDecl()
Writes the XML declaration:
|
public XMLOutputStream(OStream stream) throws XMLConstructorException
XMLOutputStream
that wraps stream.
XMLConstructorException
public XMLOutputStream(OStream stream, java.lang.String encoding) throws XMLConstructorException
XMLOutputStream
that wraps stream.
XMLConstructorException
public XMLOutputStream(OStream stream, java.lang.String encoding, boolean writeXMLDecl) throws XMLConstructorException
XMLOutputStream
that wraps stream.
XMLConstructorException
public XMLOutputStream(OStream stream, java.lang.String encoding, boolean writeXMLDecl, java.lang.String programName) throws XMLConstructorException
XMLOutputStream
that wraps stream.
XMLConstructorException
public XMLOutputStream(OStream stream, java.lang.String encoding, boolean writeXMLDecl, java.lang.String programName, java.lang.String programVersion) throws XMLConstructorException
XMLOutputStream
that wraps stream.
XMLConstructorException
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the XMLOutputStream.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke XMLOutputStream.delete()
themselves.
public void downIndent()
XMLOutputStream
.public void endElement(java.lang.String name)
XMLOutputStream
.public void endElement(java.lang.String name, java.lang.String prefix)
XMLOutputStream
.public void endElement(XMLTriple triple)
XMLOutputStream
.public boolean equals(java.lang.Object sb)
Because the Java methods for libSBML are actually wrappers around code
implemented in C++ and C, certain operations will not behave as
expected. Equality comparison is one such case. An instance of a
libSBML object class is actually a proxy object
wrapping the real underlying C/C++ object. The normal ==
equality operator in Java will only compare the Java proxy objects,
not the underlying native object. The result is almost never what you
want in practical situations. Unfortunately, Java does not provide a
way to override ==
.
The alternative that must be followed is to use the
equals()
method. The equals
method on this
class overrides the default java.lang.Object one, and performs an
intelligent comparison of instances of objects of this class. The
result is an assessment of whether two libSBML Java objects are truly
the same underlying native-code objects.
The use of this method in practice is the same as the use of any other
Java equals
method. For example,
a.equals(
b)
returns
true
if a and b are references to the
same underlying object.
equals
 in class java.lang.Object
sb
- a reference to an object to which the current object
instance will be comparedtrue
if sb
refers to the same underlying
native object as this one, false
otherwisepublic SBMLNamespaces getSBMLNamespaces()
SBMLNamespaces
object attached to this XMLInputStream
if it has been set, null otherwise.
SBMLNamespaces
object or null if none has been set.public int hashCode()
hashCode
 in class java.lang.Object
public void setAutoIndent(boolean indent)
XMLOutputStream
.public void setSBMLNamespaces(SBMLNamespaces sbmlns)
SBMLNamespaces
object to allow this stream to reference
the available SBML namespaces being read.public void startElement(java.lang.String name)
XMLOutputStream
.public void startElement(java.lang.String name, java.lang.String prefix)
XMLOutputStream
.public void startElement(XMLTriple triple)
XMLOutputStream
.public void startEndElement(java.lang.String name)
XMLOutputStream
.public void startEndElement(java.lang.String name, java.lang.String prefix)
XMLOutputStream
.public void startEndElement(XMLTriple triple)
XMLOutputStream
.public void upIndent()
XMLOutputStream
.public void writeAttribute(java.lang.String name, boolean value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, double value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, int value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String prefix, boolean value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String prefix, double value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String prefix, int value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String prefix, long value)
XMLOutputStream
.public void writeAttribute(java.lang.String name, java.lang.String prefix, java.lang.String value)
XMLOutputStream
.public void writeAttribute(XMLTriple triple, boolean value)
XMLOutputStream
.public void writeAttribute(XMLTriple triple, double value)
XMLOutputStream
.public void writeAttribute(XMLTriple triple, int value)
XMLOutputStream
.public void writeAttribute(XMLTriple triple, java.lang.String value)
XMLOutputStream
.public void writeComment(java.lang.String programName, java.lang.String programVersion)
public void writeXMLDecl()