Class JvmModelAssociator

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void associate​(org.eclipse.emf.ecore.EObject sourceElement, org.eclipse.emf.ecore.EObject jvmElement)
      Associated the given source element with the given jvmElement.
      void associateLogicalContainer​(XExpression logicalChild, org.eclipse.xtext.common.types.JvmIdentifiableElement element)
      Sets the given JvmIdentifiableElement as the logical container of the given XExpression.
      void associatePrimary​(org.eclipse.emf.ecore.EObject sourceElement, org.eclipse.emf.ecore.EObject jvmElement)
      Associated the given source element with the given jvmElement and marks the association as primary on both sides.
      protected void checkLanguageResource​(org.eclipse.emf.ecore.resource.Resource eResource)  
      protected void checkSameResource​(org.eclipse.emf.ecore.resource.Resource eResource, org.eclipse.emf.ecore.resource.Resource eResource2)  
      void cleanAssociationState​(org.eclipse.emf.ecore.resource.Resource resource)  
      void discardDerivedState​(org.eclipse.xtext.resource.DerivedStateAwareResource resource)  
      XExpression getAssociatedExpression​(org.eclipse.xtext.common.types.JvmIdentifiableElement element)  
      java.util.Set<org.eclipse.emf.ecore.EObject> getJvmElements​(org.eclipse.emf.ecore.EObject sourceElement)  
      protected org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer​(org.eclipse.emf.ecore.EObject object, boolean considerContainer)  
      org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer​(XExpression context)  
      protected java.util.Map<org.eclipse.emf.ecore.EObject,​org.eclipse.xtext.common.types.JvmIdentifiableElement> getLogicalContainerMapping​(org.eclipse.emf.ecore.resource.Resource resource)  
      org.eclipse.xtext.common.types.JvmIdentifiableElement getNearestLogicalContainer​(org.eclipse.emf.ecore.EObject context)  
      protected JvmModelAssociator.Adapter getOrInstall​(org.eclipse.emf.ecore.resource.Resource resource)  
      org.eclipse.emf.ecore.EObject getPrimaryJvmElement​(org.eclipse.emf.ecore.EObject sourceElement)  
      org.eclipse.emf.ecore.EObject getPrimarySourceElement​(org.eclipse.emf.ecore.EObject jvmElement)  
      protected org.eclipse.emf.ecore.resource.Resource getResource​(org.eclipse.emf.common.notify.Notifier ctx)  
      java.util.Set<org.eclipse.emf.ecore.EObject> getSourceElements​(org.eclipse.emf.ecore.EObject jvmElement)  
      void installDerivedState​(org.eclipse.xtext.resource.DerivedStateAwareResource resource, boolean preIndexingPhase)  
      boolean isPrimaryJvmElement​(org.eclipse.emf.ecore.EObject jvmElement)  
      static <K,​V>
      void
      putIntoSmallSetMap​(K key, V value, java.util.Map<? super K,​java.util.Set<V>> map)  
      static <K,​V>
      void
      putIntoSmallSetMap​(K key, V value, java.util.Map<? super K,​java.util.Set<V>> map, boolean head)  
      void removeAllAssociation​(org.eclipse.emf.ecore.EObject jvmElement)
      Removes all associations for the given jvm element.
      void removeAssociation​(org.eclipse.emf.ecore.EObject sourceElement, org.eclipse.emf.ecore.EObject jvmElement)
      Removes an association between the given source and jvm elements.
      void removeLogicalChildAssociation​(org.eclipse.xtext.common.types.JvmIdentifiableElement container)
      Removes the logically contained child of the given identifiable.
      void setCompleter​(JvmModelCompleter completer)  
      void setInferrerProvider​(com.google.inject.Provider<IJvmModelInferrer> inferrerProvider)  
      protected java.util.Map<org.eclipse.emf.ecore.EObject,​java.util.Set<org.eclipse.emf.ecore.EObject>> sourceToTargetMap​(org.eclipse.emf.ecore.resource.Resource res)  
      protected java.util.Map<org.eclipse.emf.ecore.EObject,​java.util.Set<org.eclipse.emf.ecore.EObject>> targetToSourceMap​(org.eclipse.emf.ecore.resource.Resource res)  
      • Methods inherited from class java.lang.Object

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

      • JvmModelAssociator

        public JvmModelAssociator()
    • Method Detail

      • setInferrerProvider

        public void setInferrerProvider​(com.google.inject.Provider<IJvmModelInferrer> inferrerProvider)
        Since:
        2.8
        Noreference:
        This method is not intended to be referenced by clients
      • getLogicalContainerMapping

        protected java.util.Map<org.eclipse.emf.ecore.EObject,​org.eclipse.xtext.common.types.JvmIdentifiableElement> getLogicalContainerMapping​(org.eclipse.emf.ecore.resource.Resource resource)
      • getLogicalContainer

        public org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer​(XExpression context)
        Specified by:
        getLogicalContainer in interface ILogicalContainerProvider
        Returns:
        the JvmIdentifiableElement that directly contains the given expression and therefore defines its scope. null if this expression doesn't have such a context.
      • getNearestLogicalContainer

        public org.eclipse.xtext.common.types.JvmIdentifiableElement getNearestLogicalContainer​(org.eclipse.emf.ecore.EObject context)
        Specified by:
        getNearestLogicalContainer in interface ILogicalContainerProvider
        Returns:
        the JvmIdentifiableElement that contains the given expression or any of its containers and therefore defines its scope. null if this expression doesn't live in such a context.
      • getLogicalContainer

        protected org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer​(org.eclipse.emf.ecore.EObject object,
                                                                                            boolean considerContainer)
      • associateLogicalContainer

        public void associateLogicalContainer​(XExpression logicalChild,
                                              org.eclipse.xtext.common.types.JvmIdentifiableElement element)
        Description copied from interface: IJvmModelAssociator
        Sets the given JvmIdentifiableElement as the logical container of the given XExpression. The container must be an instanceof JvmExecutable or JvmField. The logical container is used to scope and link the given expression. Associating the logical container of an expression, automatically removes any previously logical containers for the given expression.
        Specified by:
        associateLogicalContainer in interface IJvmModelAssociator
        Parameters:
        logicalChild - the expression that is put into a scope
        element - a method, constructor or field that should act as the logical container of the given expression
      • removeLogicalChildAssociation

        public void removeLogicalChildAssociation​(org.eclipse.xtext.common.types.JvmIdentifiableElement container)
        Description copied from interface: IJvmModelAssociator
        Removes the logically contained child of the given identifiable.
        Specified by:
        removeLogicalChildAssociation in interface IJvmModelAssociator
      • sourceToTargetMap

        protected java.util.Map<org.eclipse.emf.ecore.EObject,​java.util.Set<org.eclipse.emf.ecore.EObject>> sourceToTargetMap​(org.eclipse.emf.ecore.resource.Resource res)
      • targetToSourceMap

        protected java.util.Map<org.eclipse.emf.ecore.EObject,​java.util.Set<org.eclipse.emf.ecore.EObject>> targetToSourceMap​(org.eclipse.emf.ecore.resource.Resource res)
      • getResource

        protected org.eclipse.emf.ecore.resource.Resource getResource​(org.eclipse.emf.common.notify.Notifier ctx)
      • associate

        public void associate​(org.eclipse.emf.ecore.EObject sourceElement,
                              org.eclipse.emf.ecore.EObject jvmElement)
        Description copied from interface: IJvmModelAssociator
        Associated the given source element with the given jvmElement.
        Specified by:
        associate in interface IJvmModelAssociator
        Parameters:
        sourceElement - the source EObject
        jvmElement - the inferred EObject
      • checkLanguageResource

        protected void checkLanguageResource​(org.eclipse.emf.ecore.resource.Resource eResource)
      • checkSameResource

        protected void checkSameResource​(org.eclipse.emf.ecore.resource.Resource eResource,
                                         org.eclipse.emf.ecore.resource.Resource eResource2)
      • associatePrimary

        public void associatePrimary​(org.eclipse.emf.ecore.EObject sourceElement,
                                     org.eclipse.emf.ecore.EObject jvmElement)
        Description copied from interface: IJvmModelAssociator
        Associated the given source element with the given jvmElement and marks the association as primary on both sides.
        Specified by:
        associatePrimary in interface IJvmModelAssociator
        Parameters:
        sourceElement - the source EObject
        jvmElement - the inferred EObject
      • putIntoSmallSetMap

        public static <K,​V> void putIntoSmallSetMap​(K key,
                                                          V value,
                                                          java.util.Map<? super K,​java.util.Set<V>> map)
      • putIntoSmallSetMap

        public static <K,​V> void putIntoSmallSetMap​(K key,
                                                          V value,
                                                          java.util.Map<? super K,​java.util.Set<V>> map,
                                                          boolean head)
      • getJvmElements

        public java.util.Set<org.eclipse.emf.ecore.EObject> getJvmElements​(org.eclipse.emf.ecore.EObject sourceElement)
        Specified by:
        getJvmElements in interface IJvmModelAssociations
        Returns:
        all JVM elements associated with the given source element.
      • getSourceElements

        public java.util.Set<org.eclipse.emf.ecore.EObject> getSourceElements​(org.eclipse.emf.ecore.EObject jvmElement)
        Specified by:
        getSourceElements in interface IJvmModelAssociations
        Returns:
        all source elements associated with the given JVM element.
      • getPrimarySourceElement

        public org.eclipse.emf.ecore.EObject getPrimarySourceElement​(org.eclipse.emf.ecore.EObject jvmElement)
        Specified by:
        getPrimarySourceElement in interface IJvmModelAssociations
        Returns:
        the primary source element for the given JVM element.
      • installDerivedState

        public void installDerivedState​(org.eclipse.xtext.resource.DerivedStateAwareResource resource,
                                        boolean preIndexingPhase)
        Specified by:
        installDerivedState in interface org.eclipse.xtext.resource.IDerivedStateComputer
      • discardDerivedState

        public void discardDerivedState​(org.eclipse.xtext.resource.DerivedStateAwareResource resource)
        Specified by:
        discardDerivedState in interface org.eclipse.xtext.resource.IDerivedStateComputer
      • cleanAssociationState

        public void cleanAssociationState​(org.eclipse.emf.ecore.resource.Resource resource)
      • removeAssociation

        public void removeAssociation​(org.eclipse.emf.ecore.EObject sourceElement,
                                      org.eclipse.emf.ecore.EObject jvmElement)
        Description copied from interface: IJvmModelAssociator
        Removes an association between the given source and jvm elements.
        Specified by:
        removeAssociation in interface IJvmModelAssociator
      • getPrimaryJvmElement

        public org.eclipse.emf.ecore.EObject getPrimaryJvmElement​(org.eclipse.emf.ecore.EObject sourceElement)
        Specified by:
        getPrimaryJvmElement in interface IJvmModelAssociations
        Returns:
        the primary JVM element for the given source element.
      • isPrimaryJvmElement

        public boolean isPrimaryJvmElement​(org.eclipse.emf.ecore.EObject jvmElement)
        Specified by:
        isPrimaryJvmElement in interface IJvmModelAssociations
        Returns:
        whether the given JVM element is a primary JVM element.