// Check if model already exists
// First, check in current model manager
if (allModels.get(qualifier) != null)
throw new ModelException("Operation", "Model '" + qualifier + "' already exists");
// Then, check in other model managers
if (getParentModelMgr() != null)
{
Model existingModel = getParentModelMgr().getOptionalModelByQualifier(qualifier);;
if (existingModel != null)
{
throw new ModelException("Operation", "Model '" + qualifier + "' already loaded by model manager '" + existingModel.getModelMgr().getClass().getName() + "'.");
}
}
// Now that the model descriptor has been written, we can link the new model
// into the top level/all models list.