public abstract class AbstractDeclarativeScopeProvider extends AbstractScopeProvider implements IDelegatingScopeProvider
IScope scope_[EClassName]_[EReferenceName](MyType context, EReference ref)
That is if getScope(EObject, EReference)
is called where EReference is e.g. Property.type and
the ctx is an instance of Property, than the corresponding signature could be:
IScope scope_Property_type(Property prop, EReference ref)
If there is no method with the given name and a first parameter type which is compatible to the actual context
object, the implementation invokes getPredicate(EObject, EReference)
for the eContainer of the context
EObject. For instance of a Property resides in an Entity the getScope(EObject, EReference)
would be called
for the containing Entity. This is done as long as there is an eContainer. getPredicate(EObject, EClass)
):
IScope scope_[EClassName](MyType context, EReference ref)
For instance if a scope provider is asked to return all Entities which are visible from a certain Property, it looks
for a method like this:
IScope scope_Entity(Property property, EReference ref)
Again the first parameter can also be any super type of the actual type and the
implementation walks up the containment hierarchy again.
If still no method could be found null
is returnedModifier and Type | Field and Description |
---|---|
org.apache.log4j.Logger |
logger |
static java.lang.String |
NAMED_DELEGATE |
static java.lang.String |
NAMED_ERROR_HANDLER |
Constructor and Description |
---|
AbstractDeclarativeScopeProvider() |
Modifier and Type | Method and Description |
---|---|
protected IScope |
delegateGetScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference) |
IScopeProvider |
getDelegate()
Provides access to the delegate.
|
PolymorphicDispatcher.ErrorHandler<IScope> |
getErrorHandler() |
protected com.google.common.base.Predicate<java.lang.reflect.Method> |
getPredicate(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EClass type) |
protected com.google.common.base.Predicate<java.lang.reflect.Method> |
getPredicate(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference) |
IScope |
getScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
Returns a scope for the given context.
|
protected IScope |
polymorphicFindScopeForClassName(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference) |
protected IScope |
polymorphicFindScopeForReferenceName(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference) |
void |
setDelegate(IScopeProvider delegate) |
void |
setErrorHandler(PolymorphicDispatcher.ErrorHandler<IScope> errorHandler) |
public static final java.lang.String NAMED_DELEGATE
public static final java.lang.String NAMED_ERROR_HANDLER
public final org.apache.log4j.Logger logger
protected IScope delegateGetScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
public void setDelegate(IScopeProvider delegate)
public IScopeProvider getDelegate()
IDelegatingScopeProvider
getDelegate
in interface IDelegatingScopeProvider
null
.protected com.google.common.base.Predicate<java.lang.reflect.Method> getPredicate(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EClass type)
protected com.google.common.base.Predicate<java.lang.reflect.Method> getPredicate(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
public IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
IScopeProvider
getScope
in interface IScopeProvider
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 given EReference
.reference
- the reference for which to get the scope.IScope
representing the inner most IScope
for the
passed context and reference. Note for implementors: The result may not be null
.
Return IScope.NULLSCOPE
instead.protected IScope polymorphicFindScopeForClassName(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
protected IScope polymorphicFindScopeForReferenceName(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference)
public void setErrorHandler(PolymorphicDispatcher.ErrorHandler<IScope> errorHandler)
public PolymorphicDispatcher.ErrorHandler<IScope> getErrorHandler()