}
} else {
// TODO: SBML syntax error, throw an exception?
}
} else if (list.getParentSBMLObject() instanceof KineticLaw) {
KineticLaw kineticLaw = (KineticLaw) list
.getParentSBMLObject();
if (elementName.equals("parameter")
&& list.getSBaseListType().equals(
ListOf.Type.listOfParameters)) {
LocalParameter localParameter = (LocalParameter) newContextObject;
kineticLaw.addLocalParameter(localParameter);
return localParameter;
} else {
// TODO: SBML syntax error, throw an exception?
}
} else {
// TODO: SBML syntax error, throw an exception?
}
} else if (contextObject instanceof UnitDefinition) {
UnitDefinition unitDefinition = (UnitDefinition) contextObject;
if (elementName.equals("listOfUnits")) {
ListOf<Unit> listOfUnits = (ListOf<Unit>) newContextObject;
unitDefinition.setListOfUnits(listOfUnits);
return listOfUnits;
}
} else if (contextObject instanceof Reaction) {
Reaction reaction = (Reaction) contextObject;
if (elementName.equals("listOfReactants")) {
ListOf listOfReactants = (ListOf) newContextObject;
reaction.setListOfReactants(listOfReactants);
listOfReactants
.setSBaseListType(ListOf.Type.listOfReactants);
return listOfReactants;
} else if (elementName.equals("listOfProducts")) {
ListOf listOfProducts = (ListOf) newContextObject;
reaction.setListOfProducts(listOfProducts);
listOfProducts
.setSBaseListType(ListOf.Type.listOfProducts);
return listOfProducts;
} else if (elementName.equals("kineticLaw")) {
KineticLaw kineticLaw = (KineticLaw) newContextObject;
reaction.setKineticLaw(kineticLaw);
return kineticLaw;
} else {
// TODO: SBML syntax error, throw an exception?
}
} else if (contextObject instanceof KineticLaw) {
KineticLaw kineticLaw = (KineticLaw) contextObject;
if (elementName.equals("listOfParameters")) {
ListOf listOfLocalParameters = (ListOf) newContextObject;
kineticLaw
.setListOfLocalParameters(listOfLocalParameters);
listOfLocalParameters
.setSBaseListType(ListOf.Type.listOfParameters);
return listOfLocalParameters;