Class ModelLoader<Model extends net.ssehub.easy.basics.modelManagement.IModel>
- java.lang.Object
-
- net.ssehub.easy.producer.core.persistence.standard.ModelLoader<Model>
-
- Type Parameters:
Model- One ofProjectorScript.
class ModelLoader<Model extends net.ssehub.easy.basics.modelManagement.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 net.ssehub.easy.basics.logger.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, net.ssehub.easy.basics.modelManagement.ModelManagement<Model> modelManagement, Configuration.PathKind modelType)voidloadModel(java.lang.String projectName, java.lang.String projectVersion, Configuration.PathKind modelType)
-
-
-
Field Detail
-
LOGGER
private static final net.ssehub.easy.basics.logger.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:Project=Configuration.PathKind.IVMLScript=Configuration.PathKind.VIL
- 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, net.ssehub.easy.basics.modelManagement.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:Project=VarModel.INSTANCEScript=BuildModel.INSTANCE
modelType- Must match to the givenIModeltype:Project=Configuration.PathKind.IVMLScript=Configuration.PathKind.VIL
- 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.- Parameters:
projectName- The name of theIModelto load.projectVersion- TheVersionof theIModelto load.modelType- Must match to the givenIModeltype:Project=Configuration.PathKind.IVMLScript=Configuration.PathKind.VIL
- Returns:
- An empty
IModel, with the given name.
-
-