Class VilModelQuery

    • Constructor Detail

      • VilModelQuery

        public VilModelQuery()
    • Method Detail

      • getModelElement

        public IBuildlangElement getModelElement​(java.lang.String selectedElement,
                                                 java.lang.String selectedElementsProjectName)
        Description copied from interface: IModelQuery
        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.
        Specified by:
        getModelElement in interface IModelQuery<Script,​IBuildlangElement,​ILanguageElement>
        Parameters:
        selectedElement - the name of the selected element as a String for which the element in the model should be found.
        selectedElementsProjectName - the name of the project of the selected element as a String which 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 null if the element could not be found.
      • getParentProject

        public Script getParentProject​(IBuildlangElement modelElement)
        Description copied from interface: IModelQuery
        Returns the parent model/project the model element is declared in.
        Specified by:
        getParentProject in interface IModelQuery<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 null if the given model element is null, 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.
      • findScriptElement

        public static IBuildlangElement findScriptElement​(Script model,
                                                          java.lang.String name)
        Tries to find an element declaration for name.
        Parameters:
        model - the model
        name - the name to search for
        Returns:
        the declaration or null