Class IModelAccess
- java.lang.Object
-
- net.ssehub.easy.integration.common.IModelAccess
-
- net.ssehub.easy.integration.common.eclipse.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 Summary
Constructors Constructor Description IModelAccess()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.eclipse.core.runtime.IPathabsoluteToWorkspaceRoot(org.eclipse.core.runtime.IPath path)Makes the given project-relativepathabsolute to the workspace root.java.util.List<IModelInfo>getAvailableModels(org.eclipse.core.resources.IProject project)Returns the models which are available for and visible fromproject.IModelInfogetMostRecentTopLevelModel(org.eclipse.core.resources.IProject project)Returns the most recent (regarding its version number) top-level model.java.util.List<IModelInfo>getTopLevelModels(org.eclipse.core.resources.IProject project)Returns the top-level models inprojectaccording to EASy conventions.protected ProjectobtainProject(IModelInfo info)Obtains a project.voidupdateModelInfo(org.eclipse.core.resources.IProject project)Updates the available model information inproject.-
Methods inherited from class net.ssehub.easy.integration.common.IModelAccess
checkInfo, createInfo, getInfo, getMostRecentModel, matchesOrigin
-
-
-
-
Method Detail
-
absoluteToWorkspaceRoot
public static org.eclipse.core.runtime.IPath absoluteToWorkspaceRoot(org.eclipse.core.runtime.IPath path)
Makes the given project-relativepathabsolute 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 inprojectaccording 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 fromproject. 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:
obtainProjectin classIModelAccess- 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 modeljava.lang.IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
updateModelInfo
public void updateModelInfo(org.eclipse.core.resources.IProject project) throws ModelExceptionUpdates the available model information inproject.- Parameters:
project- the project to update the information for- Throws:
ModelException- in case of errors during the update
-
-