Class VilModelQuery
- java.lang.Object
-
- de.uni_hildesheim.sse.ui.hyperlinking.VilModelQuery
-
- All Implemented Interfaces:
IModelQuery<Script,IBuildlangElement,ILanguageElement>,ModelUtils.IModelFinder<Script,IBuildlangElement>
public class VilModelQuery extends java.lang.Object implements IModelQuery<Script,IBuildlangElement,ILanguageElement>, ModelUtils.IModelFinder<Script,IBuildlangElement>
VIL Model Query implementation.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static VilModelQueryINSTANCE
-
Constructor Summary
Constructors Constructor Description VilModelQuery()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ILanguageElementfindDeclaration(Script project, IBuildlangElement modelElement)Finds a model element an returns a generic result.IBuildlangElementfindElement(Script model, java.lang.String name)Tries to find an element declaration forname.static IBuildlangElementfindScriptElement(Script model, java.lang.String name)Tries to find an element declaration forname.IBuildlangElementgetModelElement(java.lang.String selectedElement, java.lang.String selectedElementsProjectName)Returns the element of the model identified by the selected element (the name) and the scope which is the name of the project the selected element is located in.ModelManagement<Script>getModelManagement()Returns the model management instance.ScriptgetParentProject(IBuildlangElement modelElement)Returns the parent model/project the model element is declared in.
-
-
-
Field Detail
-
INSTANCE
public static final VilModelQuery INSTANCE
-
-
Method Detail
-
getModelManagement
public ModelManagement<Script> getModelManagement()
Description copied from interface:IModelQueryReturns the model management instance.- Specified by:
getModelManagementin interfaceIModelQuery<Script,IBuildlangElement,ILanguageElement>- Returns:
- the model management instance
-
getModelElement
public IBuildlangElement getModelElement(java.lang.String selectedElement, java.lang.String selectedElementsProjectName)
Description copied from interface:IModelQueryReturns the element of the model identified by the selected element (the name) and the scope which is the name of the project the selected element is located in.- Specified by:
getModelElementin interfaceIModelQuery<Script,IBuildlangElement,ILanguageElement>- Parameters:
selectedElement- the name of the selected element as aStringfor which the element in the model should be found.selectedElementsProjectName- the name of the project of the selected element as aStringwhich is used as the starting point for finding the corresponding element in the model- Returns:
- the element in the model identified by the given name of the selected
element. May return
nullif the element could not be found.
-
getParentProject
public Script getParentProject(IBuildlangElement modelElement)
Description copied from interface:IModelQueryReturns the parent model/project the model element is declared in.- Specified by:
getParentProjectin interfaceIModelQuery<Script,IBuildlangElement,ILanguageElement>- Parameters:
modelElement- the model element for which the parent project should be found- Returns:
- the parent project the given model element is declared in. May return
nullif the given model element isnull, if the model element has no top-level parent (which typically is the project, or the top-level parent is not an instance of project.
-
findDeclaration
public ILanguageElement findDeclaration(Script project, IBuildlangElement modelElement)
Description copied from interface:IModelQueryFinds a model element an returns a generic result.- Specified by:
findDeclarationin interfaceIModelQuery<Script,IBuildlangElement,ILanguageElement>- Parameters:
project- the project to search withinmodelElement- the model element- Returns:
- the result, null if not found
-
findElement
public IBuildlangElement findElement(Script model, java.lang.String name)
Description copied from interface:ModelUtils.IModelFinderTries to find an element declaration forname.- Specified by:
findElementin interfaceModelUtils.IModelFinder<Script,IBuildlangElement>- Parameters:
model- the modelname- the name to search for- Returns:
- the declaration or null
-
findScriptElement
public static IBuildlangElement findScriptElement(Script model, java.lang.String name)
Tries to find an element declaration forname.- Parameters:
model- the modelname- the name to search for- Returns:
- the declaration or null
-
-