species.addExtension(SpatialConstants.namespaceURI, spatialSpecies);
}
contextObject = spatialSpecies;
} else if (contextObject instanceof Reaction) {
Reaction reaction = (Reaction) contextObject;
SpatialReactionPlugin spatialReaction = null;
if (reaction.getExtension(SpatialConstants.namespaceURI) != null) {
spatialReaction = (SpatialReactionPlugin) reaction.getExtension(SpatialConstants.namespaceURI);
} else {
spatialReaction = new SpatialReactionPlugin(reaction);
reaction.addExtension(SpatialConstants.namespaceURI, spatialReaction);
}
contextObject = spatialReaction;
}