Class ModelLoader<Model extends IModel>
- java.lang.Object
-
- net.ssehub.easy.producer.core.persistence.standard.ModelLoader<Model>
-
class ModelLoader<Model extends IModel> extends java.lang.ObjectPart of thePersistencer, responsible for loading IVML/VIL models.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationlocationprivate static EASyLoggerFactory.EASyLoggerLOGGERprivate PersistentProjectproject
-
Constructor Summary
Constructors Constructor Description ModelLoader(PersistentProject project, Configuration location)Sole constructor of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ModelcreateEmptyModel(java.lang.String projectName, java.lang.String projectVersion, Configuration.PathKind modelType)Creates an emptyIModel, if the specified model could not be loaded.private ModelContainer<?>loadModel(java.lang.String projectName, java.lang.String projectVersion, ModelManagement<Model> modelManagement, Configuration.PathKind modelType)voidloadModel(java.lang.String projectName, java.lang.String projectVersion, Configuration.PathKind modelType)
-
-
-
Field Detail
-
LOGGER
private static final EASyLoggerFactory.EASyLogger LOGGER
-
project
private PersistentProject project
-
location
private Configuration location
-
-
Constructor Detail
-
ModelLoader
public ModelLoader(PersistentProject project, Configuration location)
Sole constructor of this class.- Parameters:
project- ThePersistentProjectwhich is currently loaded by thePersistencer.location- TheConfigurationof thePersistentProject.
-
-
Method Detail
-
loadModel
public void loadModel(java.lang.String projectName, java.lang.String projectVersion, Configuration.PathKind modelType) throws PersistenceException- Parameters:
projectName- The name of theIModelto load.projectVersion- TheVersionof theIModelto load.modelType- Must match to the givenIModeltype:- Throws:
PersistenceException- Will be thrown if an error occurred during theModelManagement.load(ModelInfo)operation.
-
loadModel
private ModelContainer<?> loadModel(java.lang.String projectName, java.lang.String projectVersion, ModelManagement<Model> modelManagement, Configuration.PathKind modelType) throws PersistenceException
- Parameters:
projectName- The name of theIModelto load.projectVersion- TheVersionof theIModelto load.modelManagement- Must match to the givenIModeltype:modelType- Must match to the givenIModeltype:- Returns:
- The loaded
ModelContainer. - Throws:
PersistenceException- Will be thrown if an error occurred during theModelManagement.load(ModelInfo)operation.
-
createEmptyModel
private Model createEmptyModel(java.lang.String projectName, java.lang.String projectVersion, Configuration.PathKind modelType)
Creates an emptyIModel, if the specified model could not be loaded. This should preventNullPointerExceptions in the rest of the application.
-
-