org.sbml.jsbml.xml.parsers
public class SBMLLevel1Version1Parser extends java.lang.Object implements ReadingParser, WritingParser
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Class<? extends java.lang.Object>> |
SBMLCoreElements |
Constructor and Description |
---|
SBMLLevel1Version1Parser() |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.lang.Object> |
getListOfSBMLElementsToWrite(java.lang.Object sbase)
Returns the list of children of the
objectToWrite . |
java.lang.String |
getParserNamespace() |
private void |
initializeCoreElements() |
void |
processAttribute(java.lang.String elementName,
java.lang.String attributeName,
java.lang.String value,
java.lang.String prefix,
boolean isLastAttribute,
java.lang.Object contextObject)
Process the XML attribute and modify 'contextObject' in consequence.
|
void |
processCharactersOf(java.lang.String elementName,
java.lang.String characters,
java.lang.Object contextObject)
Process the text of a XML element and modify 'contextObject' in consequence.
|
void |
processEndDocument(SBMLDocument sbmlDocument)
Process the end of the document.
|
boolean |
processEndElement(java.lang.String elementName,
java.lang.String prefix,
boolean isNested,
java.lang.Object contextObject)
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)
Process the namespace and modify the contextObject in consequence.
|
java.lang.Object |
processStartElement(java.lang.String elementName,
java.lang.String prefix,
boolean hasAttributes,
boolean hasNamespaces,
java.lang.Object contextObject)
Process the XML element and modify 'contextObject' in consequence.
|
private void |
setAssignmentRuleVariable(AssignmentRule rule,
Model model) |
private void |
setCompartmentCompartmentType(Compartment compartment,
Model model) |
private void |
setCompartmentOutside(Compartment compartment,
Model model) |
private void |
setCompartmentUnits(Compartment compartment,
Model model) |
private void |
setEventAssignmentVariable(EventAssignment eventAssignment,
Model model) |
private void |
setEventTimeUnits(Event event,
Model model) |
private void |
setInitialAssignmentSymbol(InitialAssignment initialAssignment,
Model model) |
private void |
setParameterUnits(QuantityWithUnit parameter,
Model model) |
private void |
setRateRuleVariable(RateRule rule,
Model model) |
private void |
setReactionCompartment(Reaction reaction,
Model model) |
private void |
setSpeciesCompartment(Species species,
Model model) |
private void |
setSpeciesConversionFactor(Species species,
Model model) |
private void |
setSpeciesReferenceSpecies(SimpleSpeciesReference speciesReference,
Model model) |
private void |
setSpeciesSpeciesType(Species species,
Model model) |
private void |
setSpeciesSubstanceUnits(Species species,
Model model) |
void |
writeAttributes(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Adds the XML attributes of the
sbmlElementToWrite to the attributes
HashMap of the xmlObject . |
void |
writeCharacters(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Sets the characters of xmlObject depending on the sbml element to write.
|
void |
writeElement(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Sets the name of xmlObject (if it is not set) to the element name of
sbmlElementToWrite.
|
void |
writeNamespaces(SBMLObjectForXML xmlObject,
java.lang.Object sbmlElementToWrite)
Sets the namespace of xmlObject (if it is not set) to the namespace of
sbmlElementToWrite.
|
protected java.util.HashMap<java.lang.String,java.lang.Class<? extends java.lang.Object>> SBMLCoreElements
public SBMLLevel1Version1Parser() throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
java.io.IOException
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 java.lang.String getParserNamespace()
private void initializeCoreElements() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void processAttribute(java.lang.String elementName, java.lang.String attributeName, java.lang.String value, java.lang.String prefix, boolean isLastAttribute, java.lang.Object contextObject)
ReadingParser
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
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 initialised 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.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
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 prefix, boolean hasAttributes, boolean hasNamespaces, java.lang.Object contextObject)
ReadingParser
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 setAssignmentRuleVariable(AssignmentRule rule, Model model)
rule
- model
- private void setCompartmentCompartmentType(Compartment compartment, Model model)
compartment
- model
- private void setCompartmentOutside(Compartment compartment, Model model)
compartment
- model
- private void setCompartmentUnits(Compartment compartment, Model model)
compartment
- model
- private void setEventAssignmentVariable(EventAssignment eventAssignment, Model model)
eventAssignment
- model
- private void setEventTimeUnits(Event event, Model model)
event
- model
- private void setInitialAssignmentSymbol(InitialAssignment initialAssignment, Model model)
initialAssignment
- model
- private void setParameterUnits(QuantityWithUnit parameter, Model model)
parameter
- model
- private void setRateRuleVariable(RateRule rule, Model model)
rule
- model
- private void setReactionCompartment(Reaction reaction, Model model)
reaction
- model
- private void setSpeciesCompartment(Species species, Model model)
species
- model
- private void setSpeciesConversionFactor(Species species, Model model)
species
- model
- private void setSpeciesReferenceSpecies(SimpleSpeciesReference speciesReference, Model model)
speciesReference
- model
- private void setSpeciesSpeciesType(Species species, Model model)
species
- model
- private void setSpeciesSubstanceUnits(Species species, Model model)
species
- model
- 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 write