Class PersistentProject
- java.lang.Object
-
- net.ssehub.easy.producer.core.persistence.datatypes.PersistentProject
-
public class PersistentProject extends java.lang.ObjectTop-layer class for persistent loading and saving of projects.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringidThe ID of this project.private java.io.FilelocationThe location of the project.private ScriptContainermainBuildScriptThis script should be the entry point for defining VIL build script.private Model[]modelsThis array is for storing non ivml information.private ProjectContainerprojectThis project holds all variability information related to the current project.private java.lang.StringprojectNameThe name of the (eclipse) project.
-
Constructor Summary
Constructors Constructor Description PersistentProject(java.io.File location)Constructor for reading persistent information and transforming them into an object model.PersistentProject(net.ssehub.easy.varModel.model.Project project, java.io.File location, java.io.File configFolder, Model... models)Constructor for saving an already existing project.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcreateModels()This method creates emptyModels for storing persistent information.voidexchangeModel(Model model)This method exchanges the given model with the corresponding model of the same type.java.lang.StringgetID()Getter for the ID of this project.java.io.FilegetLocation()Returns the location of the project.ScriptContainergetMainBuildScript()Getter for the main VIL build script model.ModelgetModel(int index)Returns a model specified byindex.ModelgetModel(ModelType type)Getter for the models of this project.intgetModelCount()Returns the number of models.java.lang.StringgetName()Getter for the (eclipse) name of this project.ProjectContainergetProject()Getter for the IVML variability model.net.ssehub.easy.basics.modelManagement.VersiongetVersion()Fetter for the version of this project.voidsetID(java.lang.String id)Deprecated.should be replaced by the ivml qualified name of the project.voidsetName(java.lang.String projectName)Setter for the name of this (eclipse) project.voidsetProject(net.ssehub.easy.varModel.model.Project project, Configuration location)Setter for the ivml project, which should be read/saved.voidsetScript(net.ssehub.easy.instantiation.core.model.buildlangModel.Script mainBuildScript, Configuration location)Setter for the main VIL build script file.voidsetScript(ScriptContainer mainBuildScript)Setter for the main VIL build script file.voidsetVarModel(ProjectContainer varModel)Setter for the ivml project, which should be read/saved.
-
-
-
Field Detail
-
models
private Model[] models
This array is for storing non ivml information.
-
project
private ProjectContainer project
This project holds all variability information related to the current project.
-
mainBuildScript
private ScriptContainer mainBuildScript
This script should be the entry point for defining VIL build script.
-
location
private java.io.File location
The location of the project.
-
id
private java.lang.String id
The ID of this project. This id should be replaced by the qualified name of the project.
-
projectName
private java.lang.String projectName
The name of the (eclipse) project.
-
-
Constructor Detail
-
PersistentProject
public PersistentProject(java.io.File location)
Constructor for reading persistent information and transforming them into an object model.- Parameters:
location- the location of the project.
-
PersistentProject
public PersistentProject(net.ssehub.easy.varModel.model.Project project, java.io.File location, java.io.File configFolder, Model... models)Constructor for saving an already existing project.- Parameters:
project- The IVML variability model which should be saved.location- the location of the project.configFolder- The folder storing the loaded project.models- Non ivml information which should also be saved
-
-
Method Detail
-
createModels
private void createModels()
This method creates emptyModels for storing persistent information.
-
exchangeModel
public void exchangeModel(Model model)
This method exchanges the given model with the corresponding model of the same type.- Parameters:
model- The model which should be stored in thisPersistentProject.
-
getProject
public ProjectContainer getProject()
Getter for the IVML variability model.- Returns:
- The ivml variability model or
null, if no variability model was found during persistent reading.
-
getMainBuildScript
public ScriptContainer getMainBuildScript()
Getter for the main VIL build script model.- Returns:
- The VIL build script or
null, if no build script was found during persistent reading.
-
getModel
public Model getModel(ModelType type)
Getter for the models of this project.- Parameters:
type- The type of the desired model.- Returns:
- The desired model or
nullif no concrete model with the specified type could be resolved.
-
getModelCount
public int getModelCount()
Returns the number of models.- Returns:
- The number of models.
-
getModel
public Model getModel(int index)
Returns a model specified byindex.- Parameters:
index- a 0-based index specifying model to be returned- Returns:
- all models of the project
- Throws:
java.lang.IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
setID
@Deprecated public void setID(java.lang.String id)
Deprecated.should be replaced by the ivml qualified name of the project.Setter for the id.- Parameters:
id- the id of this project.
-
getID
public java.lang.String getID()
Getter for the ID of this project.- Returns:
- The ID of this project.
-
setName
public void setName(java.lang.String projectName)
Setter for the name of this (eclipse) project.- Parameters:
projectName- The name of the (eclipse) project.
-
getName
public java.lang.String getName()
Getter for the (eclipse) name of this project.- Returns:
- The name of this project.
-
getVersion
public net.ssehub.easy.basics.modelManagement.Version getVersion()
Fetter for the version of this project.- Returns:
- The version of this project or
nullif no version is specified.
-
setProject
public void setProject(net.ssehub.easy.varModel.model.Project project, Configuration location)Setter for the ivml project, which should be read/saved.- Parameters:
project- A ivml project (must not be null).location- The folder storing the loaded project.
-
setVarModel
public void setVarModel(ProjectContainer varModel)
Setter for the ivml project, which should be read/saved.- Parameters:
varModel- A managedProjectin aProjectContainer(must not be null).
-
setScript
public void setScript(net.ssehub.easy.instantiation.core.model.buildlangModel.Script mainBuildScript, Configuration location)Setter for the main VIL build script file.- Parameters:
mainBuildScript- The entry point for the build script definition (must not be null).location- The folder storing the loaded project.
-
setScript
public void setScript(ScriptContainer mainBuildScript)
Setter for the main VIL build script file.- Parameters:
mainBuildScript- A managedScriptin aScriptContainer(must not be null).
-
getLocation
public java.io.File getLocation()
Returns the location of the project.- Returns:
- the location
-
-