public class JvmModelAssociator extends java.lang.Object implements IJvmModelAssociations, IJvmModelAssociator, ILogicalContainerProvider, 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,
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(DerivedStateAwareResource resource)
is called when the resource is updated.
|
XExpression |
getAssociatedExpression(JvmIdentifiableElement element) |
java.util.Set<org.eclipse.emf.ecore.EObject> |
getJvmElements(org.eclipse.emf.ecore.EObject sourceElement) |
protected JvmIdentifiableElement |
getLogicalContainer(org.eclipse.emf.ecore.EObject object,
boolean considerContainer) |
JvmIdentifiableElement |
getLogicalContainer(XExpression context) |
protected java.util.Map<org.eclipse.emf.ecore.EObject,JvmIdentifiableElement> |
getLogicalContainerMapping(org.eclipse.emf.ecore.resource.Resource resource) |
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(DerivedStateAwareResource resource,
boolean preIndexingPhase)
callback to do modifications when and before getContents is called the first time on a resource.
|
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(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,JvmIdentifiableElement> getLogicalContainerMapping(org.eclipse.emf.ecore.resource.Resource resource)
public XExpression getAssociatedExpression(JvmIdentifiableElement element)
getAssociatedExpression
in interface ILogicalContainerProvider
JvmIdentifiableElement
public JvmIdentifiableElement getLogicalContainer(XExpression context)
getLogicalContainer
in interface ILogicalContainerProvider
null
if this expression doesn't have such a context.public JvmIdentifiableElement getNearestLogicalContainer(org.eclipse.emf.ecore.EObject context)
getNearestLogicalContainer
in interface ILogicalContainerProvider
null
if this expression doesn't live in such a context.protected JvmIdentifiableElement getLogicalContainer(org.eclipse.emf.ecore.EObject object, boolean considerContainer)
public void associateLogicalContainer(XExpression logicalChild, JvmIdentifiableElement element)
IJvmModelAssociator
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.associateLogicalContainer
in interface IJvmModelAssociator
logicalChild
- 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(JvmIdentifiableElement container)
IJvmModelAssociator
removeLogicalChildAssociation
in interface IJvmModelAssociator
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)
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)
IJvmModelAssociator
associate
in interface IJvmModelAssociator
sourceElement
- 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)
IJvmModelAssociator
associatePrimary
in interface IJvmModelAssociator
sourceElement
- 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 IJvmModelAssociations
public java.util.Set<org.eclipse.emf.ecore.EObject> getSourceElements(org.eclipse.emf.ecore.EObject jvmElement)
getSourceElements
in interface IJvmModelAssociations
public org.eclipse.emf.ecore.EObject getPrimarySourceElement(org.eclipse.emf.ecore.EObject jvmElement)
getPrimarySourceElement
in interface IJvmModelAssociations
public void installDerivedState(DerivedStateAwareResource resource, boolean preIndexingPhase)
IDerivedStateComputer
installDerivedState
in interface IDerivedStateComputer
resource
- the resource to install derived state onpreIndexingPhase
- whether the call is done in a pre-linking phase. During this phase clients may not do linking which
relies on indexed information, because the index might not be fully computed yet.public void discardDerivedState(DerivedStateAwareResource resource)
IDerivedStateComputer
IDerivedStateComputer.installDerivedState(DerivedStateAwareResource, boolean)
discardDerivedState
in interface IDerivedStateComputer
public void cleanAssociationState(org.eclipse.emf.ecore.resource.Resource resource)
public void removeAssociation(org.eclipse.emf.ecore.EObject sourceElement, org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociator
removeAssociation
in interface IJvmModelAssociator
public void removeAllAssociation(org.eclipse.emf.ecore.EObject jvmElement)
IJvmModelAssociator
removeAllAssociation
in interface IJvmModelAssociator
public org.eclipse.emf.ecore.EObject getPrimaryJvmElement(org.eclipse.emf.ecore.EObject sourceElement)
getPrimaryJvmElement
in interface IJvmModelAssociations
JvmElementsProxifyingUnloader
element for the given source element.public boolean isPrimaryJvmElement(org.eclipse.emf.ecore.EObject jvmElement)
isPrimaryJvmElement
in interface IJvmModelAssociations