org.eclipse.ocl.examples.xtext.base.scoping.pivot
Class AbstractScopeAdapter<T extends org.eclipse.emf.ecore.EObject>

java.lang.Object
  extended by org.eclipse.ocl.examples.xtext.base.scoping.pivot.AbstractScopeAdapter<T>
Type Parameters:
T -
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, TypeManagedAdapter, ScopeAdapter
Direct Known Subclasses:
AbstractPivotScopeAdapter, DefaultScopeAdapter, ElementCSScopeAdapter

public abstract class AbstractScopeAdapter<T extends org.eclipse.emf.ecore.EObject>
extends java.lang.Object
implements ScopeAdapter, org.eclipse.emf.common.notify.Adapter.Internal

A AbstractScopeAdapter provides the basic behaviour for a family of derived classes that provide additional scope/environment behaviour for corresponding CS elements.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.xtext.base.scope.ScopeAdapter
ScopeAdapter.Switch
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
protected  ScopeAdapter parent
           
protected  T target
          The last notifier set to this adapter.
 
Constructor Summary
protected AbstractScopeAdapter(TypeManager typeManager, ScopeAdapter parent, T target)
           
 
Method Summary
 void computeLookup(EnvironmentView environmentView, org.eclipse.emf.ecore.EReference targetReference)
           
 ScopeView computeLookup(EnvironmentView environmentView, ScopeView scopeView)
          Add the local lookup contributions to a view of an Environment.
 void dispose()
           
static RootScopeAdapter getDocumentScopeAdapter(ModelElementCS context)
           
static RootScopeAdapter getDocumentScopeAdapter(TypeManager typeManager, Element context)
           
 ScopeView getInnerScopeView(TypeManager typeManager, org.eclipse.emf.ecore.EReference targetReference)
           
 ScopeView getOuterScopeView(TypeManager typeManager, org.eclipse.emf.ecore.EReference targetReference)
           
 ScopeAdapter getParent()
           
static ScopeAdapter getScopeAdapter(TypeManager typeManager, Element eObject)
           
static ScopeCSAdapter getScopeCSAdapter(ElementCS csElement)
           
 ScopeAdapter getSourceScope(org.eclipse.emf.ecore.EStructuralFeature containmentFeature)
           
 T getTarget()
           
 boolean isAdapterFor(TypeManager typeManager)
           
 boolean isAdapterForType(java.lang.Object type)
           
 void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
          Does nothing; clients may override so that it does something.
 void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
           
 void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.xtext.base.scope.ScopeAdapter
getRootScopeAdapter
 

Field Detail

target

protected final T extends org.eclipse.emf.ecore.EObject target
The last notifier set to this adapter.


parent

protected final ScopeAdapter parent
Constructor Detail

AbstractScopeAdapter

protected AbstractScopeAdapter(TypeManager typeManager,
                               ScopeAdapter parent,
                               T target)
Method Detail

getDocumentScopeAdapter

public static RootScopeAdapter getDocumentScopeAdapter(TypeManager typeManager,
                                                       Element context)

getDocumentScopeAdapter

public static RootScopeAdapter getDocumentScopeAdapter(ModelElementCS context)

getScopeAdapter

public static ScopeAdapter getScopeAdapter(TypeManager typeManager,
                                           Element eObject)

getScopeCSAdapter

public static ScopeCSAdapter getScopeCSAdapter(ElementCS csElement)

computeLookup

public ScopeView computeLookup(EnvironmentView environmentView,
                               ScopeView scopeView)
Description copied from interface: ScopeAdapter
Add the local lookup contributions to a view of an Environment.

The EnvironmentView contains the lookup matching criteria such as a specific name and accumulates candidate results.

The input ScopeView identifies the CST node and the containment of the CST child from which the lookup is made allowing derived implementations to present the alternative environments specified as the Inherited Attributes in the OCL Specification.

The returned ScopeView identifies an outer scope in which the lookup may be continued if the local candidate results are not suitable.

Specified by:
computeLookup in interface ScopeAdapter
Parameters:
environmentView - the EnvironmentView to compute
scopeView - the access selectivity to be applied by the lookup
Returns:
an outer ScopeView in which to continue the lookup, or null if none

computeLookup

public final void computeLookup(EnvironmentView environmentView,
                                org.eclipse.emf.ecore.EReference targetReference)
Specified by:
computeLookup in interface ScopeAdapter

dispose

public void dispose()
Specified by:
dispose in interface TypeManagedAdapter

getInnerScopeView

public ScopeView getInnerScopeView(TypeManager typeManager,
                                   org.eclipse.emf.ecore.EReference targetReference)
Specified by:
getInnerScopeView in interface ScopeAdapter

getOuterScopeView

public ScopeView getOuterScopeView(TypeManager typeManager,
                                   org.eclipse.emf.ecore.EReference targetReference)
Specified by:
getOuterScopeView in interface ScopeAdapter

getParent

public ScopeAdapter getParent()
Specified by:
getParent in interface ScopeAdapter

getSourceScope

public ScopeAdapter getSourceScope(org.eclipse.emf.ecore.EStructuralFeature containmentFeature)
Specified by:
getSourceScope in interface ScopeAdapter

getTarget

public T getTarget()
Specified by:
getTarget in interface org.eclipse.emf.common.notify.Adapter
Specified by:
getTarget in interface ScopeAdapter

isAdapterFor

public boolean isAdapterFor(TypeManager typeManager)
Specified by:
isAdapterFor in interface TypeManagedAdapter

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)
Specified by:
isAdapterForType in interface org.eclipse.emf.common.notify.Adapter

notifyChanged

public void notifyChanged(org.eclipse.emf.common.notify.Notification msg)
Does nothing; clients may override so that it does something.

Specified by:
notifyChanged in interface org.eclipse.emf.common.notify.Adapter

setTarget

public void setTarget(org.eclipse.emf.common.notify.Notifier newTarget)
Specified by:
setTarget in interface org.eclipse.emf.common.notify.Adapter

unsetTarget

public void unsetTarget(org.eclipse.emf.common.notify.Notifier oldTarget)
Specified by:
unsetTarget in interface org.eclipse.emf.common.notify.Adapter.Internal