Class IModelAccess


  • public abstract class IModelAccess
    extends IModelAccess
    A basic class providing access to models. Specific tool integrations shall add specific methods on how to access or even create models.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • IModelAccess

        public IModelAccess()
    • Method Detail

      • absoluteToWorkspaceRoot

        public static org.eclipse.core.runtime.IPath absoluteToWorkspaceRoot​(org.eclipse.core.runtime.IPath path)
        Makes the given project-relative path absolute to the workspace root.
        Parameters:
        path - the path to make absolute
        Returns:
        the absolute path
      • getMostRecentTopLevelModel

        public IModelInfo getMostRecentTopLevelModel​(org.eclipse.core.resources.IProject project)
        Returns the most recent (regarding its version number) top-level model.
        Parameters:
        project - the project to return the modle for
        Returns:
        the most recent model (may be null if there is none)
      • getTopLevelModels

        public java.util.List<IModelInfo> getTopLevelModels​(org.eclipse.core.resources.IProject project)
        Returns the top-level models in project according to EASy conventions.
        Parameters:
        project - the project to return the default models for
        Returns:
        the top-level models as considered by EASy
      • getAvailableModels

        public java.util.List<IModelInfo> getAvailableModels​(org.eclipse.core.resources.IProject project)
        Returns the models which are available for and visible from project. The result of this method may change over time, e.g. when models are created.
        Parameters:
        project - the project where to start searching / considering models
        Returns:
        the model information objects representing available projects
      • obtainProject

        protected Project obtainProject​(IModelInfo info)
                                 throws ModelException
        Obtains a project.
        Overrides:
        obtainProject in class IModelAccess
        Parameters:
        info - the model information instance representing the project to obtain
        Returns:
        the project instance
        Throws:
        ModelException - in case of errors during obtaining/loading the model
        java.lang.IllegalArgumentException - in case that info is null or does not match to this implementation
      • updateModelInfo

        public void updateModelInfo​(org.eclipse.core.resources.IProject project)
                             throws ModelException
        Updates the available model information in project.
        Parameters:
        project - the project to update the information for
        Throws:
        ModelException - in case of errors during the update