org.sbml.jsbml.xml.parsers
private org.apache.log4j.Logger logger
private static final java.lang.String namespaceURI
private LayoutParser.LayoutList groupList
private org.apache.log4j.Logger log4jLogger
private java.util.HashMap<java.lang.String,java.lang.Class<? extends java.lang.Object>> sbmlLayoutElements
public static java.lang.String getNamespaceURI()
public java.util.List<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 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 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 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.private void setNamespace(SBase sbase, java.lang.String namespace)
sbase
- namespace
- 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 stackprivate void setLevelAndVersionFor(java.lang.Object newContextObject, SBase parent)
newContextObject
- parent
- public 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 handlingpublic SBasePlugin createPluginFor(SBase sbase)
PackageParser
createPluginFor
in interface PackageParser
sbase
- - the sbase for which you want to create an SBasePlugin
SBasePlugin
corresponding to the given SBase
.public java.lang.String getNamespaceFor(int level, int version, int packageVersion)
PackageParser
Returns null if the combined level, version and packageVersion is invalid or not known from the package parser implementation.
getNamespaceFor
in interface PackageParser
level
- - the SBML levelversion
- - the SBML versionpackageVersion
- - the package versionpublic java.util.List<java.lang.String> getPackageNamespaces()
PackageParser
List
of all the valid namespaces for the package.getPackageNamespaces
in interface PackageParser
List
of all the valid namespaces for the package.public java.lang.String getPackageName()
PackageParser
getPackageName
in interface PackageParser
public boolean isRequired()
PackageParser
required
attribute for this package.isRequired
in interface PackageParser
required
attribute for this package.