org.eclipse.ocl.examples.xtext.base.scoping
Class BaseScopeView

java.lang.Object
  extended by org.eclipse.xtext.scoping.impl.AbstractScope
      extended by org.eclipse.ocl.examples.xtext.base.scoping.BaseScopeView
All Implemented Interfaces:
ScopeView, IScopeView, org.eclipse.xtext.scoping.IScope

public class BaseScopeView
extends org.eclipse.xtext.scoping.impl.AbstractScope
implements IScopeView

ScopeViews support access to some or all of the elements in a scope. Accesses are filtered on the fly since a cache of results does not remain valid for long enough to merit it, with incremental reparsing regularly trashing the CST.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
org.eclipse.xtext.scoping.impl.AbstractScope.ParentIterable
 
Field Summary
protected  ElementCS child
           
protected  boolean isQualified
           
protected  MetaModelManager metaModelManager
           
static IScopeView NULLSCOPEVIEW
          The NULLSCOPEVIEW to be returned by the most outer scope
protected  ElementCS target
           
protected  org.eclipse.emf.ecore.EReference targetReference
           
 
Fields inherited from interface org.eclipse.xtext.scoping.IScope
NULLSCOPE
 
Constructor Summary
protected BaseScopeView(MetaModelManager metaModelManager, ElementCS target, ElementCS child, org.eclipse.emf.ecore.EReference targetReference, boolean isQualified)
           
 
Method Summary
 java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements()
           
protected  java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllLocalElements()
           
 Attribution getAttribution()
          Return Attribution instance that defines the lookup algorithm for the target node.
 ElementCS getChild()
          Return the immediate child node for which a lookup is requested.
 org.eclipse.emf.ecore.EStructuralFeature getContainmentFeature()
          Return the containment feature of the child within the target.
 java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object)
           
 java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.xtext.naming.QualifiedName name)
           
 MetaModelManager getMetaModelManager()
           
 IScopeView getParent()
          Return the ScopeView that characterizes a lookup in the parent of the target node.
 IScopeView getRoot()
          Return the ScopeView that characterizes a lookup at the top level.
static BaseScopeView getScopeView(MetaModelManager metaModelManager, ElementCS target, org.eclipse.emf.ecore.EReference targetReference)
           
 org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.emf.ecore.EObject object)
           
 org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.xtext.naming.QualifiedName name)
           
 ElementCS getTarget()
          Return the target node at which this ScopeView characterizes a lookup.
 boolean isQualified()
          Return true if the lookup is within a qualified name.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
getLocalElementsByEObject, getLocalElementsByName, getParentElements, getSingleLocalElementByName, isIgnoreCase, isShadowed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULLSCOPEVIEW

@NonNull
public static final IScopeView NULLSCOPEVIEW
The NULLSCOPEVIEW to be returned by the most outer scope


metaModelManager

@NonNull
protected final MetaModelManager metaModelManager

target

@NonNull
protected final ElementCS target

child

@Nullable
protected final ElementCS child

targetReference

@NonNull
protected final org.eclipse.emf.ecore.EReference targetReference

isQualified

protected final boolean isQualified
Constructor Detail

BaseScopeView

protected BaseScopeView(@NonNull
                        MetaModelManager metaModelManager,
                        @NonNull
                        ElementCS target,
                        @Nullable
                        ElementCS child,
                        @NonNull
                        org.eclipse.emf.ecore.EReference targetReference,
                        boolean isQualified)
Method Detail

getScopeView

@NonNull
public static BaseScopeView getScopeView(@NonNull
                                                 MetaModelManager metaModelManager,
                                                 @NonNull
                                                 ElementCS target,
                                                 @NonNull
                                                 org.eclipse.emf.ecore.EReference targetReference)

getAttribution

@NonNull
public Attribution getAttribution()
Description copied from interface: ScopeView
Return Attribution instance that defines the lookup algorithm for the target node.

Specified by:
getAttribution in interface ScopeView

getAllElements

public java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllElements()
Specified by:
getAllElements in interface org.eclipse.xtext.scoping.IScope
Overrides:
getAllElements in class org.eclipse.xtext.scoping.impl.AbstractScope

getAllLocalElements

protected final java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getAllLocalElements()
Specified by:
getAllLocalElements in class org.eclipse.xtext.scoping.impl.AbstractScope

getChild

@Nullable
public ElementCS getChild()
Description copied from interface: ScopeView
Return the immediate child node for which a lookup is requested.

Specified by:
getChild in interface ScopeView

getContainmentFeature

public org.eclipse.emf.ecore.EStructuralFeature getContainmentFeature()
Description copied from interface: ScopeView
Return the containment feature of the child within the target.

Specified by:
getContainmentFeature in interface ScopeView

getElements

public java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.xtext.naming.QualifiedName name)
Specified by:
getElements in interface org.eclipse.xtext.scoping.IScope
Overrides:
getElements in class org.eclipse.xtext.scoping.impl.AbstractScope

getElements

public java.lang.Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object)
Specified by:
getElements in interface org.eclipse.xtext.scoping.IScope
Overrides:
getElements in class org.eclipse.xtext.scoping.impl.AbstractScope

getMetaModelManager

public MetaModelManager getMetaModelManager()

getParent

@NonNull
public IScopeView getParent()
Description copied from interface: ScopeView
Return the ScopeView that characterizes a lookup in the parent of the target node.

Specified by:
getParent in interface ScopeView
Specified by:
getParent in interface IScopeView
Overrides:
getParent in class org.eclipse.xtext.scoping.impl.AbstractScope

getRoot

@NonNull
public IScopeView getRoot()
Description copied from interface: ScopeView
Return the ScopeView that characterizes a lookup at the top level.

Specified by:
getRoot in interface ScopeView
Specified by:
getRoot in interface IScopeView

getSingleElement

public org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.emf.ecore.EObject object)
Specified by:
getSingleElement in interface org.eclipse.xtext.scoping.IScope
Overrides:
getSingleElement in class org.eclipse.xtext.scoping.impl.AbstractScope

getSingleElement

@Nullable
public org.eclipse.xtext.resource.IEObjectDescription getSingleElement(org.eclipse.xtext.naming.QualifiedName name)
Specified by:
getSingleElement in interface org.eclipse.xtext.scoping.IScope
Overrides:
getSingleElement in class org.eclipse.xtext.scoping.impl.AbstractScope

getTarget

@NonNull
public final ElementCS getTarget()
Description copied from interface: ScopeView
Return the target node at which this ScopeView characterizes a lookup.

Specified by:
getTarget in interface ScopeView

isQualified

public final boolean isQualified()
Description copied from interface: ScopeView
Return true if the lookup is within a qualified name.

Specified by:
isQualified in interface ScopeView

toString

public java.lang.String toString()
Overrides:
toString in class org.eclipse.xtext.scoping.impl.AbstractScope