Class ProjectContainer
- java.lang.Object
-
- net.ssehub.easy.producer.core.varMod.container.ModelContainer<net.ssehub.easy.varModel.model.Project>
-
- net.ssehub.easy.producer.core.varMod.container.ProjectContainer
-
- All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IModelData,net.ssehub.easy.basics.modelManagement.IModelListener<net.ssehub.easy.varModel.model.Project>
public class ProjectContainer extends ModelContainer<net.ssehub.easy.varModel.model.Project>
ModelContainerfor holding a Project and its configuration.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private net.ssehub.easy.varModel.confModel.Configurationconfig
-
Constructor Summary
Constructors Constructor Description ProjectContainer(net.ssehub.easy.varModel.model.Project project, Configuration location)Default constructor for a created of loadedProject.ProjectContainer(net.ssehub.easy.varModel.model.Project project, SemanticErrorDescription description, Configuration location)Constructor if an Exception occurred during parsing theProject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.ssehub.easy.varModel.confModel.ConfigurationgetConfiguration()Returns the configuration related to the storedProject.java.io.FilegetLocation()Returns the location, where the model is loaded from.voidnotifyReplaced(net.ssehub.easy.varModel.model.Project oldProject, net.ssehub.easy.varModel.model.Project newProject)If this method is called, the storedModelContainer.getDescription()will be set to null as this is usually only called if the parser has parsed the model successfully.voidsetMainModel(net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> newMainModel)Changes the managed Model.-
Methods inherited from class net.ssehub.easy.producer.core.varMod.container.ModelContainer
getDescription, getHighestVersion, getLocation, getModel, getName, getVersion, isSaveable, listAvailableModels, registerModelListener, unregisterModelListener
-
-
-
-
Constructor Detail
-
ProjectContainer
public ProjectContainer(net.ssehub.easy.varModel.model.Project project, Configuration location)Default constructor for a created of loadedProject.- Parameters:
project- A valid project, which shall be managed by thisModelContainer.location- The location (folder) of the managed project.
-
ProjectContainer
public ProjectContainer(net.ssehub.easy.varModel.model.Project project, SemanticErrorDescription description, Configuration location)Constructor if an Exception occurred during parsing theProject. TheProjectcan be used but not be saved, as long the semantic error is not solved.- Parameters:
project- TheProject, which should be managed by this container.description- description A description of an occurred semantic error while parsing theProject. Can be null, then this constructor has the same behavior as#ProjectContainer(Project).location- The location (folder) of the managed project.
-
-
Method Detail
-
notifyReplaced
public void notifyReplaced(net.ssehub.easy.varModel.model.Project oldProject, net.ssehub.easy.varModel.model.Project newProject)If this method is called, the storedModelContainer.getDescription()will be set to null as this is usually only called if the parser has parsed the model successfully.- Specified by:
notifyReplacedin interfacenet.ssehub.easy.basics.modelManagement.IModelListener<net.ssehub.easy.varModel.model.Project>- Overrides:
notifyReplacedin classModelContainer<net.ssehub.easy.varModel.model.Project>
-
getConfiguration
public net.ssehub.easy.varModel.confModel.Configuration getConfiguration()
Returns the configuration related to the storedProject.- Returns:
- the configuration related to the stored
Project. - See Also:
ModelContainer.getModel()
-
setMainModel
public void setMainModel(net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> newMainModel)
Description copied from class:ModelContainerChanges the managed Model. The model should be add the specified location (ModelContainer.getLocation().- Overrides:
setMainModelin classModelContainer<net.ssehub.easy.varModel.model.Project>- Parameters:
newMainModel- The model that should be used by this container.- See Also:
ModelContainer.listAvailableModels()
-
getLocation
public java.io.File getLocation()
Description copied from class:ModelContainerReturns the location, where the model is loaded from.- Specified by:
getLocationin classModelContainer<net.ssehub.easy.varModel.model.Project>- Returns:
- The location of the loaded model.
-
-