ListOf<Objective> listOfObjectives = fbcModel.getListOfObjectives();
groupList = FBCList.listOfObjectives;
return listOfObjectives;
}
} else if (contextObject instanceof Objective) {
Objective objective = (Objective) contextObject;
if (elementName.equals("listOfFluxObjectives") || elementName.equals("listOfFluxes")) {
// listOfFluxes was the first name of listOfFluxObjectives in the preliminary specifications
ListOf<FluxObjective> listOfFluxObjectives = objective.getListOfFluxObjectives();
groupList = FBCList.listOfFluxObjectives;
return listOfFluxObjectives;
}
}
else if (contextObject instanceof ListOf<?>) {
ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
if (elementName.equals("fluxBound")
&& groupList.equals(FBCList.listOfFluxBounds)) {
Model model = (Model) listOf.getParentSBMLObject();
FBCModelPlugin extendeModel = (FBCModelPlugin) model.getExtension(FBCConstants.namespaceURI);
FluxBound fluxBound = new FluxBound();
extendeModel.addFluxBound(fluxBound);
return fluxBound;
} else if (elementName.equals("objective")
&& groupList.equals(FBCList.listOfObjectives)) {
Model model = (Model) listOf.getParentSBMLObject();
FBCModelPlugin extendeModel = (FBCModelPlugin) model.getExtension(FBCConstants.namespaceURI);
Objective objective = new Objective();
extendeModel.addObjective(objective);
return objective;
} else if (elementName.equals("fluxObjective")
&& groupList.equals(FBCList.listOfFluxObjectives)) {
Objective objective = (Objective) listOf.getParentSBMLObject();
FluxObjective fluxObjective = new FluxObjective();
objective.addFluxObjective(fluxObjective);
return fluxObjective;
}
}