Package org.eclipse.xtext.scoping.impl
Class DelegatingScopeProvider
- java.lang.Object
-
- org.eclipse.xtext.scoping.impl.AbstractScopeProvider
-
- org.eclipse.xtext.scoping.impl.DelegatingScopeProvider
-
- All Implemented Interfaces:
IDelegatingScopeProvider
,IScopeProvider
public class DelegatingScopeProvider extends AbstractScopeProvider implements IDelegatingScopeProvider
This implementation skips the declarative API of theAbstractDeclarativeScopeProvider
while still delegating to anotherprovider
. Meant to be used as the base class for custom scope providers.- Since:
- 2.4
-
-
Constructor Summary
Constructors Constructor Description DelegatingScopeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IScope
delegateGetScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
IScopeProvider
getDelegate()
Provides access to the delegate.IScope
getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
Returns a scope for the given context.void
setDelegate(IScopeProvider delegate)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.scoping.impl.IDelegatingScopeProvider
setWrapper
-
-
-
-
Method Detail
-
getScope
public IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
Description copied from interface:IScopeProvider
Returns a scope for the given context. The scope provides access to the compatible visible EObjects for a given reference.- Specified by:
getScope
in interfaceIScopeProvider
- Parameters:
context
- the element from which an element shall be referenced. It doesn't need to be the element containing the reference, it is just used to find the most inner scope for givenEReference
.reference
- the reference for which to get the scope.- Returns:
IScope
representing the innermostIScope
for the passed context and reference. Note for implementors: The result may not benull
. ReturnIScope.NULLSCOPE
instead.
-
delegateGetScope
protected IScope delegateGetScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
-
setDelegate
public void setDelegate(IScopeProvider delegate)
-
getDelegate
public IScopeProvider getDelegate()
Description copied from interface:IDelegatingScopeProvider
Provides access to the delegate.- Specified by:
getDelegate
in interfaceIDelegatingScopeProvider
- Returns:
- the delegate. May not be
null
.
-
-