Interface IEcoreModelQuery<P extends org.eclipse.emf.ecore.EObject,R>
-
- Type Parameters:
P- the type of the "project", the top-most semantic language unitR-IModelQuerysearch result type
- All Known Implementing Classes:
AbstractEcoreModelQuery,AbstractEcoreModelQuery,EcoreModelQuery,VilEcoreModelQuery,VtlEcoreModelQuery
public interface IEcoreModelQuery<P extends org.eclipse.emf.ecore.EObject,R>Performs queries on underlying models.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.eclipse.emf.ecore.EObjectgetEcoreElement(CommonXtextEditor<?,P> editor, R elementDescription)Returns theEObjectof the parse tree of the given editor's resource that matches the element described by the givenModelElementDescription.java.lang.StringgetName(P project)Returns the name of the project.PgetProject(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)Returns the "project" of the Ecore-model represented by the given root node.org.eclipse.xtext.nodemodel.ICompositeNodegetRootNode(org.eclipse.xtext.resource.XtextResource resource)Returns theICompositeNodeof the Ecore-model that represent the root node.
-
-
-
Method Detail
-
getName
java.lang.String getName(P project)
Returns the name of the project.- Parameters:
project- the project- Returns:
- the name of
project
-
getRootNode
org.eclipse.xtext.nodemodel.ICompositeNode getRootNode(org.eclipse.xtext.resource.XtextResource resource)
Returns theICompositeNodeof the Ecore-model that represent the root node.- Parameters:
resource- theXtextResourcefrom which the root node should be retrieved- Returns:
- the
ICompositeNodeof the Ecore-model that represent the root node. May returnnullif the given resource isnullor cannot be parsed
-
getProject
P getProject(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)
Returns the "project" of the Ecore-model represented by the given root node.- Parameters:
rootNode- theICompositeNodewhich is the root of the Ecore-model from which the "project" should be retrieved- Returns:
- the "project" in the given resource. May return
nullif the given root node isnull, or there is no "project" in that file
-
getEcoreElement
org.eclipse.emf.ecore.EObject getEcoreElement(CommonXtextEditor<?,P> editor, R elementDescription)
Returns theEObjectof the parse tree of the given editor's resource that matches the element described by the givenModelElementDescription. The search for this object will be performed in the Ecore-model of the given editor's resource only. This requires that it is ensured that the given editor displays a file which includes the desired element.- Parameters:
editor- theXtextEditorwhich displays the file in which the desired element should be foundelementDescription- theModelElementDescriptionthat describes the model element that should be found in the parse tree of the given editor's resource- Returns:
- the
EObjectthat matches the element described by the givenModelElementDescription. May returnnullif the element could not be found
-
-