org.sbml.jsbml.xml.parsers
MathMLStaxParser
. But we keep it in case somebody want to
use Document
@Deprecated public class MathMLParser extends java.lang.Object implements ReadingParser, WritingParser
Modifier and Type | Field and Description |
---|---|
private short |
indent
Deprecated.
The number of white spaces for the indent if this is to be used.
|
private boolean |
indenting
Deprecated.
Decides whether or not the content of the MathML string should be
indented.
|
private boolean |
omitXMLDeclaration
Deprecated.
If true no XML declaration will be written into the MathML output,
otherwise the XML version will appear at the beginning of the output.
|
private static java.lang.String |
sbmlNS
Deprecated.
The SBML attribute for the additional namespace.
|
private static java.lang.String |
sbmlUnits
Deprecated.
The attribute for SBML units.
|
Constructor and Description |
---|
MathMLParser()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkContainsNumbersReferingToUnits(org.w3c.dom.Node node)
Deprecated.
Recursively checks whether the given
Node contains any numbers
that refer to unit declarations. |
static org.w3c.dom.Document |
createMathMLDocumentFor(org.w3c.dom.Node node,
int sbmlLevel)
Deprecated.
|
static java.lang.String |
getDefinitionURIavogadro()
Deprecated.
|
static java.lang.String |
getDefinitionURIdelay()
Deprecated.
|
static java.lang.String |
getDefinitionURItime()
Deprecated.
|
int |
getIndent()
Deprecated.
|
boolean |
getIndenting()
Deprecated.
|
java.util.ArrayList<java.lang.Object> |
getListOfSBMLElementsToWrite(java.lang.Object sbase)
Deprecated.
Returns the list of children of the
objectToWrite . |
java.util.List<java.lang.String> |
getNamespaces()
Deprecated.
Returns a
List of all the namespaces that this parser is handling. |
static java.lang.String |
getNamespaceURI()
Deprecated.
|
boolean |
getOmitXMLDeclaration()
Deprecated.
|
static java.lang.String |
getSBMLNSAttribute()
Deprecated.
|
static java.lang.String |
getSBMLUnitsAttribute()
Deprecated.
|
static java.lang.String |
getXMLnamespaceSBML()
Deprecated.
The additional MathML name space for units to numbers.
|
void |
processAttribute(java.lang.String ElementName,
java.lang.String AttributeName,
java.lang.String value,
java.lang.String uri,
java.lang.String prefix,
boolean isLastAttribute,
java.lang.Object contextObject)
Deprecated.
Process the XML attribute and modify 'contextObject' in consequence.
|
void |
processCharactersOf(java.lang.String elementName,
java.lang.String characters,
java.lang.Object contextObject)
Deprecated.
Process the text of a XML element and modify 'contextObject' in
consequence.
|
void |
processEndDocument(SBMLDocument sbmlDocument)
Deprecated.
Process the end of the document.
|
boolean |
processEndElement(java.lang.String ElementName,
java.lang.String prefix,
boolean isNested,
java.lang.Object contextObject)
Deprecated.
Process the end of the element 'elementName'.
|
void |
processNamespace(java.lang.String elementName,
java.lang.String URI,
java.lang.String prefix,
java.lang.String localName,
boolean hasAttributes,
boolean isLastNamespace,
java.lang.Object contextObject)
Deprecated.
Process the namespace and modify the contextObject in consequence.
|
java.lang.Object |
processStartElement(java.lang.String ElementName,
java.lang.String uri,
java.lang.String prefix,
boolean hasAttributes,
boolean hasNamespaces,
java.lang.Object contextObject)
Deprecated.
Process the XML element and modify 'contextObject' in consequence.
|
void |
setIndent(int indent)
Deprecated.
|
void |
setIndenting(boolean indenting)
Deprecated.
|
void |
setOmitXMLDeclaration(boolean omitXMLDeclaration)
Deprecated.
|
static java.lang.String |
toMathML(org.w3c.dom.Document doc,
boolean omitXMLDeclaration,
boolean indenting,
int indent)
Deprecated.
Write output as
String . |
static void |
toMathML(java.io.Writer out,
org.w3c.dom.Document doc,
boolean omitXMLDeclaration,
boolean indenting,
int indent)
Deprecated.
|
void |
writeAttributes(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Deprecated.
Adds the XML attributes of the
sbmlElementToWrite to the attributes
HashMap of the xmlObject . |
void |
writeCharacters(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Deprecated.
Sets the characters of xmlObject depending on the sbml element to write.
|
void |
writeElement(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Deprecated.
Sets the name of xmlObject (if it is not set) to the element name of
sbmlElementToWrite.
|
void |
writeNamespaces(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Deprecated.
Sets the namespace of xmlObject (if it is not set) to the namespace of
sbmlElementToWrite.
|
private static final java.lang.String sbmlNS
private static final java.lang.String sbmlUnits
private short indent
private boolean indenting
private boolean omitXMLDeclaration
public static boolean checkContainsNumbersReferingToUnits(org.w3c.dom.Node node)
Node
contains any numbers
that refer to unit declarations. This check is necessary because this
feature has become available in SBML Level 3 and is therefore invalid in
earlier levels.node
- A node to be checked.public static org.w3c.dom.Document createMathMLDocumentFor(org.w3c.dom.Node node, int sbmlLevel) throws SBMLException
node
- sbmlLevel
- SBMLException
public static java.lang.String getDefinitionURIavogadro()
public static java.lang.String getDefinitionURIdelay()
public static java.lang.String getDefinitionURItime()
public static java.lang.String getNamespaceURI()
public static java.lang.String getSBMLNSAttribute()
public static java.lang.String getSBMLUnitsAttribute()
public static java.lang.String getXMLnamespaceSBML()
public static java.lang.String toMathML(org.w3c.dom.Document doc, boolean omitXMLDeclaration, boolean indenting, int indent) throws java.io.IOException, SBMLException
String
.omitXMLDeclaration
- indenting
- indent
- java.io.IOException
SBMLException
- If illegal references to units are made for numbers and the
SBML Level has been set to values before level 3.public static void toMathML(java.io.Writer out, org.w3c.dom.Document doc, boolean omitXMLDeclaration, boolean indenting, int indent) throws java.io.IOException, SBMLException
out
- doc
- omitXMLDeclaration
- indenting
- indent
- java.io.IOException
SBMLException
public int getIndent()
public boolean getIndenting()
public java.util.ArrayList<java.lang.Object> getListOfSBMLElementsToWrite(java.lang.Object sbase)
WritingParser
objectToWrite
.getListOfSBMLElementsToWrite
in interface WritingParser
sbase
- the SBase
component to write.SBase
' contains. Represents
the list of subNodes of this SBase
component.public boolean getOmitXMLDeclaration()
public void processAttribute(java.lang.String ElementName, java.lang.String AttributeName, java.lang.String value, java.lang.String uri, java.lang.String prefix, boolean isLastAttribute, java.lang.Object contextObject)
ReadingParser
For example, if the contextObject is an instance of Reaction
and the
attributeName is 'fast', this method will set the 'fast' variable of the
'contextObject' to 'value'. Then it will return the modified
Reaction
instance.
processAttribute
in interface ReadingParser
ElementName
- the localName of the XML element.AttributeName
- the attribute localName of the XML element.value
- the value of the XML attribute.prefix
- the attribute prefixisLastAttribute
- boolean value to know if this attribute is the last attribute of the
XML element.contextObject
- the object to set or modify depending on the identity of the current
attribute. This object
represents the context of the XML attribute in the SBMLDocument.public void processCharactersOf(java.lang.String elementName, java.lang.String characters, java.lang.Object contextObject)
ReadingParser
For example, if the contextObject is an instance of
Creator
and the elementName is 'Family',
this method will set the familyName of the 'contextObject' to the text
value. Then it will return the changed Creator
instance.
processCharactersOf
in interface ReadingParser
elementName
- the localName of the XML element.characters
- the text of this XML element.contextObject
- the object to set or modify depending on the identity of the current
element. This object
represents the context of the XML element in the SBMLDocument.public void processEndDocument(SBMLDocument sbmlDocument)
ReadingParser
processEndDocument
in interface ReadingParser
sbmlDocument
- the final initialized SBMLDocument instance.public boolean processEndElement(java.lang.String ElementName, java.lang.String prefix, boolean isNested, java.lang.Object contextObject)
ReadingParser
processEndElement
in interface ReadingParser
ElementName
- the localName of the XML element.prefix
- the prefix of the XML element.isNested
- boolean value to know if the XML element is a nested element.contextObject
- the object to set or modify depending on the identity of the current
element. This object
represents the context of the XML element in the SBMLDocument.true
to remove the contextObject from the stack, if
false
is returned the contextObject will stay on top
of the stackpublic void processNamespace(java.lang.String elementName, java.lang.String URI, java.lang.String prefix, java.lang.String localName, boolean hasAttributes, boolean isLastNamespace, java.lang.Object contextObject)
ReadingParser
For example, if the contextObject is an instance of SBMLDocument, the namespaces will be stored in the SBMLNamespaces HashMap of this SBMLDocument.
processNamespace
in interface ReadingParser
elementName
- the localName of the XML element.URI
- the URI of the namespaceprefix
- the prefix of the namespace.localName
- the localName of the namespace.hasAttributes
- boolean value to know if there are attributes after the namespace
declarations.isLastNamespace
- boolean value to know if this namespace is the last namespace of
this element.contextObject
- the object to set or modify depending on the identity of the current
element. This object
represents the context of the XML element in the SBMLDocument.public java.lang.Object processStartElement(java.lang.String ElementName, java.lang.String uri, java.lang.String prefix, boolean hasAttributes, boolean hasNamespaces, java.lang.Object contextObject)
ReadingParser
For example, if the contextObject is an instance of Event
and the
elementName is 'trigger', this method will create a new Trigger
instance
and will set the trigger instance of the 'contextObject' to the new
Trigger
. Then the method will return the new Trigger
instance which is the
new environment.
processStartElement
in interface ReadingParser
ElementName
- the localName of the XML element to processprefix
- the prefix of the XML element to processhasAttributes
- boolean value to know if this XML element has attributes.hasNamespaces
- boolean value to know if this XML element contains namespace
declarations.contextObject
- the object to set or modify depending on the identity of the current
XML element. This object
represents the context of the XML element in the SBMLDocument.public void setIndent(int indent)
indent
- the indent to setpublic void setIndenting(boolean indenting)
indenting
- the indenting to setpublic void setOmitXMLDeclaration(boolean omitXMLDeclaration)
omitXMLDeclaration
- the omitXMLDeclaration to setpublic void writeAttributes(SBMLObjectForXML xmlObject, java.lang.Object sbmlElementToWrite)
WritingParser
sbmlElementToWrite
to the attributes
HashMap of the xmlObject
.writeAttributes
in interface WritingParser
xmlObject
- contains the XML information about sbmlElement.sbmlElementToWrite
- the SBase
component to writepublic void writeCharacters(SBMLObjectForXML xmlObject, java.lang.Object sbmlElementToWrite)
WritingParser
writeCharacters
in interface WritingParser
xmlObject
- contains the XML information about sbmlElement.sbmlElementToWrite
- the SBase
component to writepublic void writeElement(SBMLObjectForXML xmlObject, java.lang.Object sbmlElementToWrite)
WritingParser
writeElement
in interface WritingParser
xmlObject
- contains the XML information about sbmlElement.sbmlElementToWrite
- the SBase
component to writepublic void writeNamespaces(SBMLObjectForXML xmlObject, java.lang.Object sbmlElementToWrite)
WritingParser
writeNamespaces
in interface WritingParser
xmlObject
- contains the XML information about sbmlElement.sbmlElementToWrite
- the SBase
component to writepublic java.util.List<java.lang.String> getNamespaces()
ReadingParser
List
of all the namespaces that this parser is handling.getNamespaces
in interface ReadingParser
getNamespaces
in interface WritingParser
List
of all the namespaces that this parser is handling