Class VilEcoreModelFinder


  • public class VilEcoreModelFinder
    extends java.lang.Object
    A Ecore model element finder for VIL.
    Author:
    Holger Eichelberger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int calcLevel​(ILanguageElement elt, java.lang.Class<?> stopCls)
      Determines the nesting level of element until stopCls.
      protected org.eclipse.emf.ecore.EObject findInRuleElt​(de.uni_hildesheim.sse.vilBuildLanguage.RuleElement elt, ILanguageElement declaration, int level)
      Tries finding declaration in elt.
      protected org.eclipse.emf.ecore.EObject findInRuleElts​(de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlock block, ILanguageElement declaration, int level)
      Tries finding declaration in the defs of block.
      protected org.eclipse.emf.ecore.EObject findInRuleElts​(java.util.List<? extends de.uni_hildesheim.sse.vilBuildLanguage.RuleElement> elts, ILanguageElement declaration, int level)
      Tries finding declaration in the defs of elts.
      org.eclipse.emf.ecore.EObject getEcoreElement​(org.eclipse.emf.ecore.EObject contentElement, ILanguageElement declaration)
      Returns the ECore object for declaration defined in contentElement.
      • Methods inherited from class java.lang.Object

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

      • VilEcoreModelFinder

        public VilEcoreModelFinder()
    • Method Detail

      • getEcoreElement

        public org.eclipse.emf.ecore.EObject getEcoreElement​(org.eclipse.emf.ecore.EObject contentElement,
                                                             ILanguageElement declaration)
        Returns the ECore object for declaration defined in contentElement.
        Parameters:
        contentElement - the content element to search within
        declaration - the declaration to search
        Returns:
        the ECore object representing declaration, may be null if not found
      • calcLevel

        protected int calcLevel​(ILanguageElement elt,
                                java.lang.Class<?> stopCls)
        Determines the nesting level of element until stopCls.
        Parameters:
        elt - the element to determine the nesting for
        stopCls - the stop class or run until the topmost parent
        Returns:
        the nesting level
      • findInRuleElts

        protected org.eclipse.emf.ecore.EObject findInRuleElts​(de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlock block,
                                                               ILanguageElement declaration,
                                                               int level)
        Tries finding declaration in the defs of block.
        Parameters:
        block - the block to search
        declaration - the declaration 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 not found
      • findInRuleElts

        protected org.eclipse.emf.ecore.EObject findInRuleElts​(java.util.List<? extends de.uni_hildesheim.sse.vilBuildLanguage.RuleElement> elts,
                                                               ILanguageElement declaration,
                                                               int level)
        Tries finding declaration in the defs of elts.
        Parameters:
        elts - the elements to search
        declaration - the declaration 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 not found
      • findInRuleElt

        protected org.eclipse.emf.ecore.EObject findInRuleElt​(de.uni_hildesheim.sse.vilBuildLanguage.RuleElement elt,
                                                              ILanguageElement declaration,
                                                              int level)
        Tries finding declaration in elt.
        Parameters:
        elt - the element to search
        declaration - the declaration 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 not found