Class PersistentProject


  • public class PersistentProject
    extends java.lang.Object
    Top-layer class for persistent loading and saving of projects.
    Author:
    El-Sharkawy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String id
      The ID of this project.
      private java.io.File location
      The location of the project.
      private ScriptContainer mainBuildScript
      This script should be the entry point for defining VIL build script.
      private Model[] models
      This array is for storing non ivml information.
      private ProjectContainer project
      This project holds all variability information related to the current project.
      private java.lang.String projectName
      The 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 void createModels()
      This method creates empty Models for storing persistent information.
      void exchangeModel​(Model model)
      This method exchanges the given model with the corresponding model of the same type.
      java.lang.String getID()
      Getter for the ID of this project.
      java.io.File getLocation()
      Returns the location of the project.
      ScriptContainer getMainBuildScript()
      Getter for the main VIL build script model.
      Model getModel​(int index)
      Returns a model specified by index.
      Model getModel​(ModelType type)
      Getter for the models of this project.
      int getModelCount()
      Returns the number of models.
      java.lang.String getName()
      Getter for the (eclipse) name of this project.
      ProjectContainer getProject()
      Getter for the IVML variability model.
      net.ssehub.easy.basics.modelManagement.Version getVersion()
      Fetter for the version of this project.
      void setID​(java.lang.String id)
      Deprecated.
      should be replaced by the ivml qualified name of the project.
      void setName​(java.lang.String projectName)
      Setter for the name of this (eclipse) project.
      void setProject​(net.ssehub.easy.varModel.model.Project project, Configuration location)
      Setter for the ivml project, which should be read/saved.
      void setScript​(net.ssehub.easy.instantiation.core.model.buildlangModel.Script mainBuildScript, Configuration location)
      Setter for the main VIL build script file.
      void setScript​(ScriptContainer mainBuildScript)
      Setter for the main VIL build script file.
      void setVarModel​(ProjectContainer varModel)
      Setter for the ivml project, which should be read/saved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 empty Models 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 this PersistentProject.
      • 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 null if 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 by index.
        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 null if 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 managed Project in a ProjectContainer (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 managed Script in a ScriptContainer (must not be null).
      • getLocation

        public java.io.File getLocation()
        Returns the location of the project.
        Returns:
        the location