Class VtlEcoreModelQuery

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private org.eclipse.emf.ecore.EObject findInDefs​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit unit, ILanguageElement element)
      Tries finding element in the defs of unit.
      private org.eclipse.emf.ecore.EObject findInStmt​(de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt stmt, ILanguageElement element, int level)
      Tries finding element in stmt.
      private org.eclipse.emf.ecore.EObject findInStmtOrStmtBlock​(de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt stmt, de.uni_hildesheim.sse.vil.templatelang.templateLang.StmtBlock block, ILanguageElement element, int level)
      Tries finding element in stmt or in block.
      private org.eclipse.emf.ecore.EObject findInStmts​(java.util.List<de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt> stmts, ILanguageElement element, int level)
      Tries finding element in stmts.
      org.eclipse.emf.ecore.EObject getEcoreElement​(CommonXtextEditor<?,​de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit> editor, ILanguageElement declaration)
      Returns the EObject of the parse tree of the given editor's resource that matches the element described by the given ModelElementDescription.
      protected de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit getLanguageUnit​(org.eclipse.xtext.resource.XtextResource resource)
      Returns the LanguageUnit in the given resource (VTL-file).
      java.lang.String getName​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit project)
      Returns the name of the project.
      de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit getProject​(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)
      Returns the "project" of the Ecore-model represented by the given root node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VtlEcoreModelQuery

        public VtlEcoreModelQuery()
    • Method Detail

      • getName

        public java.lang.String getName​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit project)
        Description copied from interface: IEcoreModelQuery
        Returns the name of the project.
        Parameters:
        project - the project
        Returns:
        the name of project
      • getProject

        public de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit getProject​(org.eclipse.xtext.nodemodel.ICompositeNode rootNode)
        Description copied from interface: IEcoreModelQuery
        Returns the "project" of the Ecore-model represented by the given root node.
        Parameters:
        rootNode - the ICompositeNode which is the root of the Ecore-model from which the "project" should be retrieved
        Returns:
        the "project" in the given resource. May return null if the given root node is null, or there is no "project" in that file
      • getEcoreElement

        public org.eclipse.emf.ecore.EObject getEcoreElement​(CommonXtextEditor<?,​de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit> editor,
                                                             ILanguageElement declaration)
        Description copied from interface: IEcoreModelQuery
        Returns the EObject of the parse tree of the given editor's resource that matches the element described by the given ModelElementDescription. 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 - the XtextEditor which displays the file in which the desired element should be found
        declaration - the ModelElementDescription that describes the model element that should be found in the parse tree of the given editor's resource
        Returns:
        the EObject that matches the element described by the given ModelElementDescription. May return null if the element could not be found
      • findInDefs

        private org.eclipse.emf.ecore.EObject findInDefs​(de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit unit,
                                                         ILanguageElement element)
        Tries finding element in the defs of unit.
        Parameters:
        defs - the unit to search
        element - the element to search for
        Returns:
        the found EObject or null
      • findInStmts

        private org.eclipse.emf.ecore.EObject findInStmts​(java.util.List<de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt> stmts,
                                                          ILanguageElement element,
                                                          int level)
        Tries finding element in stmts.
        Parameters:
        stmts - the statements to search
        element - the element to search for
        level - the actual nesting level starting with the one of element, if greater 0 recurse to the next levels
        Returns:
        the found EObject or null if there is none
      • findInStmt

        private org.eclipse.emf.ecore.EObject findInStmt​(de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt stmt,
                                                         ILanguageElement element,
                                                         int level)
        Tries finding element in stmt.
        Parameters:
        stmt - the statement to search
        element - the element to search for
        level - the actual nesting level starting with the one of element, if greater 0 recurse to the next levels
        Returns:
        the found EObject or null if there is none
      • findInStmtOrStmtBlock

        private org.eclipse.emf.ecore.EObject findInStmtOrStmtBlock​(de.uni_hildesheim.sse.vil.templatelang.templateLang.Stmt stmt,
                                                                    de.uni_hildesheim.sse.vil.templatelang.templateLang.StmtBlock block,
                                                                    ILanguageElement element,
                                                                    int level)
        Tries finding element in stmt or in block.
        Parameters:
        stmt - the statement to search (may be null)
        block - the block to search (may be null)
        element - the element to search for
        level - the actual nesting level starting with the one of element, if greater 0 recurse to the next levels
        Returns:
        the found EObject or null if there is none
      • getLanguageUnit

        protected de.uni_hildesheim.sse.vil.templatelang.templateLang.LanguageUnit getLanguageUnit​(org.eclipse.xtext.resource.XtextResource resource)
        Returns the LanguageUnit in the given resource (VTL-file).
        Parameters:
        resource - the XtextResource from which the LanguageUnit should be retrieved
        Returns:
        the LanguageUnit in the given resource. May return null if the given resource is null, cannot be parsed, or there is no LanguageUnit in that file