// TODO: make it generic by using reflection on the contextObject
if (contextObject instanceof SBMLDocument)
{
SBMLDocument sbmlDoc = (SBMLDocument) contextObject;
CompSBMLDocumentPlugin compSBMLDoc = null;
if (sbmlDoc.getExtension(namespaceURI) != null) {
compSBMLDoc = (CompSBMLDocumentPlugin) sbmlDoc.getExtension(namespaceURI);
} else {
compSBMLDoc = new CompSBMLDocumentPlugin(sbmlDoc);
sbmlDoc.addExtension(namespaceURI, compSBMLDoc);
}
if (elementName.equals(CompConstants.listOfExternalModelDefinitions))
{
return compSBMLDoc.getListOfExternalModelDefinitions();
}
else if (elementName.equals(CompConstants.listOfModelDefinitions))
{
return compSBMLDoc.getListOfModelDefinitions();
}
} // end SBMLDocument
else if (contextObject instanceof Model)
{
Model model = (Model) contextObject;