Class DefaultModelSourceExplorer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String determineSourceFilePath​(org.eclipse.emf.ecore.EObject aModelElement)
      Determines the full path to the source file in which a certain element is defined.
      protected java.lang.String determineSourceFilePath​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
      Finds the source file path for a given ICompositeNode and cleans it up, removing Xtext-specific stuff and resulting in a clean absolute path.
      ModelSourceInformationElement determineSourceInformation​(org.eclipse.emf.ecore.EObject aModelElement)
      Determines all information about the source of a model element at once.
      int determineSourceLine​(org.eclipse.emf.ecore.EObject aModelElement)
      Finds the line in the original script file at which a certain element starts.
      protected int determineSourceLine​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
      Finds the line number in the source file matching a given ICompositeNode.
      java.lang.String determineSourceSnippet​(org.eclipse.emf.ecore.EObject aModelElement)
      Finds the textual snippet from which a model element was originally parsed.
      protected java.lang.String determineSourceSnippet​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
      Finds the source snippet matching a given ICompositeNode.
      protected org.eclipse.xtext.nodemodel.ICompositeNode findNode​(org.eclipse.emf.ecore.EObject aModelElement)
      Finds the node conforming to a given model element.
      • Methods inherited from class java.lang.Object

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

      • DefaultModelSourceExplorer

        public DefaultModelSourceExplorer()
    • Method Detail

      • determineSourceFilePath

        public java.lang.String determineSourceFilePath​(org.eclipse.emf.ecore.EObject aModelElement)
        Description copied from interface: ModelSourceExplorer
        Determines the full path to the source file in which a certain element is defined.
        Specified by:
        determineSourceFilePath in interface ModelSourceExplorer
        Parameters:
        aModelElement - the element
        Returns:
        the file path
      • determineSourceFilePath

        protected java.lang.String determineSourceFilePath​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
        Finds the source file path for a given ICompositeNode and cleans it up, removing Xtext-specific stuff and resulting in a clean absolute path.
        Parameters:
        aNode - the node to investigate
        Returns:
        the path
      • determineSourceSnippet

        public java.lang.String determineSourceSnippet​(org.eclipse.emf.ecore.EObject aModelElement)
        Description copied from interface: ModelSourceExplorer
        Finds the textual snippet from which a model element was originally parsed.
        Specified by:
        determineSourceSnippet in interface ModelSourceExplorer
        Parameters:
        aModelElement - the element
        Returns:
        the snippet
      • determineSourceSnippet

        protected java.lang.String determineSourceSnippet​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
        Finds the source snippet matching a given ICompositeNode.
        Parameters:
        aNode - the node to investigate
        Returns:
        the source snippet (trimmed)
      • determineSourceLine

        public int determineSourceLine​(org.eclipse.emf.ecore.EObject aModelElement)
        Description copied from interface: ModelSourceExplorer
        Finds the line in the original script file at which a certain element starts.
        Specified by:
        determineSourceLine in interface ModelSourceExplorer
        Parameters:
        aModelElement - the element
        Returns:
        the line number
      • determineSourceLine

        protected int determineSourceLine​(org.eclipse.xtext.nodemodel.ICompositeNode aNode)
        Finds the line number in the source file matching a given ICompositeNode.
        Parameters:
        aNode - the node to investigate
        Returns:
        the line number
      • findNode

        protected org.eclipse.xtext.nodemodel.ICompositeNode findNode​(org.eclipse.emf.ecore.EObject aModelElement)
        Finds the node conforming to a given model element. This will never return null, but throw an IllegalArgumentException instead, if no node could be found.
        Parameters:
        aModelElement - the model element to investigate
        Returns:
        the node