public class JvmModelAssociator extends java.lang.Object implements IJvmModelAssociations, IJvmModelAssociator, ILogicalContainerProvider, org.eclipse.xtext.resource.IDerivedStateComputer
| Modifier and Type | Class and Description |
|---|---|
static class |
JvmModelAssociator.Adapter |
static class |
JvmModelAssociator.JvmDeclaredTypeAcceptor |
protected static class |
JvmModelAssociator.ListBasedSet<E> |
| Constructor and Description |
|---|
JvmModelAssociator() |
| Modifier and Type | Method and 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) |
public void setCompleter(JvmModelCompleter completer)
public void setInferrerProvider(com.google.inject.Provider<IJvmModelInferrer> inferrerProvider)
protected JvmModelAssociator.Adapter getOrInstall(org.eclipse.emf.ecore.resource.Resource resource)
protected java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.xtext.common.types.JvmIdentifiableElement> getLogicalContainerMapping(org.eclipse.emf.ecore.resource.Resource resource)
public XExpression getAssociatedExpression(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
getAssociatedExpression in interface ILogicalContainerProviderJvmIdentifiableElementpublic org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer(XExpression context)
getLogicalContainer in interface ILogicalContainerProvidernull if this expression doesn't have such a context.public org.eclipse.xtext.common.types.JvmIdentifiableElement getNearestLogicalContainer(org.eclipse.emf.ecore.EObject context)
getNearestLogicalContainer in interface ILogicalContainerProvidernull if this expression doesn't live in such a context.protected org.eclipse.xtext.common.types.JvmIdentifiableElement getLogicalContainer(org.eclipse.emf.ecore.EObject object,
boolean considerContainer)
public void associateLogicalContainer(XExpression logicalChild, org.eclipse.xtext.common.types.JvmIdentifiableElement element)
IJvmModelAssociatorJvmIdentifiableElement 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.associateLogicalContainer in interface IJvmModelAssociatorlogicalChild - the expression that is put into a scopeelement - a method, constructor or field that should act as the logical container of the given expressionpublic void removeLogicalChildAssociation(org.eclipse.xtext.common.types.JvmIdentifiableElement container)
IJvmModelAssociatorremoveLogicalChildAssociation in interface IJvmModelAssociatorprotected 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)
protected org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.notify.Notifier ctx)
public void associate(org.eclipse.emf.ecore.EObject sourceElement,
org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociatorassociate in interface IJvmModelAssociatorsourceElement - the source EObjectjvmElement - the inferred EObjectprotected 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)
public void associatePrimary(org.eclipse.emf.ecore.EObject sourceElement,
org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociatorassociatePrimary in interface IJvmModelAssociatorsourceElement - the source EObjectjvmElement - the inferred EObjectpublic static <K,V> void putIntoSmallSetMap(K key,
V value,
java.util.Map<? super K,java.util.Set<V>> map)
public static <K,V> void putIntoSmallSetMap(K key,
V value,
java.util.Map<? super K,java.util.Set<V>> map,
boolean head)
public java.util.Set<org.eclipse.emf.ecore.EObject> getJvmElements(org.eclipse.emf.ecore.EObject sourceElement)
getJvmElements in interface IJvmModelAssociationspublic java.util.Set<org.eclipse.emf.ecore.EObject> getSourceElements(org.eclipse.emf.ecore.EObject jvmElement)
getSourceElements in interface IJvmModelAssociationspublic org.eclipse.emf.ecore.EObject getPrimarySourceElement(org.eclipse.emf.ecore.EObject jvmElement)
getPrimarySourceElement in interface IJvmModelAssociationspublic void installDerivedState(org.eclipse.xtext.resource.DerivedStateAwareResource resource,
boolean preIndexingPhase)
installDerivedState in interface org.eclipse.xtext.resource.IDerivedStateComputerpublic void discardDerivedState(org.eclipse.xtext.resource.DerivedStateAwareResource resource)
discardDerivedState in interface org.eclipse.xtext.resource.IDerivedStateComputerpublic void cleanAssociationState(org.eclipse.emf.ecore.resource.Resource resource)
public void removeAssociation(org.eclipse.emf.ecore.EObject sourceElement,
org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociatorremoveAssociation in interface IJvmModelAssociatorpublic void removeAllAssociation(org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociatorremoveAllAssociation in interface IJvmModelAssociatorpublic org.eclipse.emf.ecore.EObject getPrimaryJvmElement(org.eclipse.emf.ecore.EObject sourceElement)
getPrimaryJvmElement in interface IJvmModelAssociationspublic boolean isPrimaryJvmElement(org.eclipse.emf.ecore.EObject jvmElement)
isPrimaryJvmElement in interface IJvmModelAssociations