org.eclipse.xtext.xbase.scoping.featurecalls
Class FilteredDelegatingScope

java.lang.Object
  extended by org.eclipse.xtext.scoping.impl.AbstractScope
      extended by org.eclipse.xtext.scoping.impl.SimpleScope
          extended by org.eclipse.xtext.xbase.scoping.featurecalls.JvmFeatureScope
              extended by org.eclipse.xtext.xbase.scoping.DelegatingScope
                  extended by org.eclipse.xtext.xbase.scoping.featurecalls.FilteredDelegatingScope
All Implemented Interfaces:
com.google.common.base.Predicate<IEObjectDescription>, IScope

public class FilteredDelegatingScope
extends DelegatingScope
implements com.google.common.base.Predicate<IEObjectDescription>

A scope implementation that allows to decorate a LazyJvmFeatureScope to apply filtering on the content.

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
AbstractScope.ParentIterable
 
Field Summary
 
Fields inherited from class org.eclipse.xtext.scoping.impl.SimpleScope
shadowingIndex
 
Fields inherited from interface org.eclipse.xtext.scoping.IScope
NULLSCOPE
 
Constructor Summary
protected FilteredDelegatingScope(IScope parent, LazyJvmFeatureScope unfiltered, boolean onlyVisibleAndValidStaticState)
           
 
Method Summary
 boolean apply(IEObjectDescription input)
           
protected  java.lang.Iterable<IEObjectDescription> getAllLocalElements()
           
protected  LazyJvmFeatureScope getDelegate()
           
 java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
          Find all descriptions that match the given name.
 java.lang.Iterable<IValidatedEObjectDescription> getJvmFeatureDescriptions()
           
protected  java.lang.Iterable<IEObjectDescription> getLocalElementsByEObject(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.common.util.URI uri)
           
protected  java.lang.Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
           
protected  IEObjectDescription getSingleLocalElementByName(QualifiedName name)
           
protected  boolean isShadowedBy(IEObjectDescription fromParent, java.lang.Iterable<IEObjectDescription> localElements)
           
 void setDelegate(IScope delegate)
           
 
Methods inherited from class org.eclipse.xtext.xbase.scoping.DelegatingScope
toString
 
Methods inherited from class org.eclipse.xtext.xbase.scoping.featurecalls.JvmFeatureScope
getScopeDescription, getShadowingKey, isShadowed
 
Methods inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
getAllElements, getElements, getParent, getParentElements, getSingleElement, getSingleElement, isIgnoreCase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Predicate
equals
 

Constructor Detail

FilteredDelegatingScope

protected FilteredDelegatingScope(IScope parent,
                                  LazyJvmFeatureScope unfiltered,
                                  boolean onlyVisibleAndValidStaticState)
Method Detail

setDelegate

public void setDelegate(IScope delegate)
Overrides:
setDelegate in class DelegatingScope

getDelegate

protected LazyJvmFeatureScope getDelegate()
Overrides:
getDelegate in class DelegatingScope

getLocalElementsByEObject

protected java.lang.Iterable<IEObjectDescription> getLocalElementsByEObject(org.eclipse.emf.ecore.EObject object,
                                                                            org.eclipse.emf.common.util.URI uri)
Overrides:
getLocalElementsByEObject in class DelegatingScope

getLocalElementsByName

protected java.lang.Iterable<IEObjectDescription> getLocalElementsByName(QualifiedName name)
Overrides:
getLocalElementsByName in class DelegatingScope

getSingleLocalElementByName

protected IEObjectDescription getSingleLocalElementByName(QualifiedName name)
Overrides:
getSingleLocalElementByName in class DelegatingScope

getAllLocalElements

protected java.lang.Iterable<IEObjectDescription> getAllLocalElements()
Overrides:
getAllLocalElements in class DelegatingScope

getJvmFeatureDescriptions

public java.lang.Iterable<IValidatedEObjectDescription> getJvmFeatureDescriptions()
Overrides:
getJvmFeatureDescriptions in class JvmFeatureScope

apply

public boolean apply(IEObjectDescription input)
Specified by:
apply in interface com.google.common.base.Predicate<IEObjectDescription>

getElements

public java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
Description copied from interface: IScope
Find all descriptions that match the given name.

Specified by:
getElements in interface IScope
Overrides:
getElements in class AbstractScope
Parameters:
name - the name of the to-be-found elements. May not be null.
Returns:
all elements that match the name. Never null.

isShadowedBy

protected boolean isShadowedBy(IEObjectDescription fromParent,
                               java.lang.Iterable<IEObjectDescription> localElements)
Overrides:
isShadowedBy in class JvmFeatureScope
See Also:
JvmFeatureScope.isShadowed(IEObjectDescription)