public abstract class AbstractSessionBasedScope extends AbstractScope
IFeatureScopeSession
.
The scope can only handle feature
references.
It does not support case insensitivity.
Clients may extend concrete subtypes and adjust the name processing or apply general
filtering by overriding addToList(IEObjectDescription, List)
or addToList(List, List)
.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractSessionBasedScope.NameAcceptor |
AbstractScope.ParentIterable
Modifier | Constructor and Description |
---|---|
protected |
AbstractSessionBasedScope(IScope parent,
IFeatureScopeSession session,
XAbstractFeatureCall featureCall) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToList(IEObjectDescription description,
java.util.List<IEObjectDescription> result)
Clients may override to reject certain descriptions from the result.
|
protected void |
addToList(java.util.List<IEObjectDescription> descriptions,
java.util.List<IEObjectDescription> result)
Clients may override to reject certain descriptions from the result.
|
protected java.util.List<JvmFeature> |
findAllFeaturesByName(JvmType type,
java.lang.String simpleName,
IResolvedFeatures.Provider resolvedFeaturesProvider) |
protected abstract java.util.List<IEObjectDescription> |
getAllLocalElements() |
java.lang.Iterable<IEObjectDescription> |
getElements(QualifiedName name)
Find all descriptions that match the given name.
|
protected XAbstractFeatureCall |
getFeatureCall() |
protected java.lang.Iterable<IEObjectDescription> |
getLocalElementsByEObject(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.common.util.URI uri) |
protected abstract java.util.List<IEObjectDescription> |
getLocalElementsByName(QualifiedName name) |
protected IFeatureScopeSession |
getSession() |
protected java.lang.String |
getShadowingKey(IEObjectDescription description) |
protected boolean |
isShadowed(IEObjectDescription fromParent)
Returns
true if the given description input from the parent scope is
shadowed by local elements. |
protected void |
processAsPropertyNames(QualifiedName name,
AbstractSessionBasedScope.NameAcceptor acceptor)
Considers the given name to be a property name.
|
protected void |
processFeatureNames(QualifiedName name,
AbstractSessionBasedScope.NameAcceptor acceptor) |
protected java.lang.String |
toProperty(java.lang.String methodName,
JvmFeature feature) |
protected java.lang.String |
toProperty(java.lang.String methodName,
JvmFeature feature,
int getterParams,
int setterParams) |
protected java.lang.String |
tryGetAsPropertyName(java.lang.String name)
Returns the name as a property name, e.g. a prefix
get , is or set
can be used with the result of this method. |
getAllElements, getElements, getParent, getParentElements, getSingleElement, getSingleElement, getSingleLocalElementByName, isIgnoreCase, toString
protected AbstractSessionBasedScope(IScope parent, IFeatureScopeSession session, XAbstractFeatureCall featureCall)
protected abstract java.util.List<IEObjectDescription> getAllLocalElements()
getAllLocalElements
in class AbstractScope
protected IFeatureScopeSession getSession()
protected XAbstractFeatureCall getFeatureCall()
protected void processFeatureNames(QualifiedName name, AbstractSessionBasedScope.NameAcceptor acceptor)
protected java.util.List<JvmFeature> findAllFeaturesByName(JvmType type, java.lang.String simpleName, IResolvedFeatures.Provider resolvedFeaturesProvider)
protected void processAsPropertyNames(QualifiedName name, AbstractSessionBasedScope.NameAcceptor acceptor)
protected java.lang.String toProperty(java.lang.String methodName, JvmFeature feature)
protected java.lang.String toProperty(java.lang.String methodName, JvmFeature feature, int getterParams, int setterParams)
protected java.lang.String tryGetAsPropertyName(java.lang.String name)
get
, is
or set
can be used with the result of this method.
If the given name is invalid, the result is null
.protected void addToList(IEObjectDescription description, java.util.List<IEObjectDescription> result)
AbstractSessionBasedScope
in the framework code will delegate to this method to accumulate descriptions in a list.addToList(List, List)
protected void addToList(java.util.List<IEObjectDescription> descriptions, java.util.List<IEObjectDescription> result)
AbstractSessionBasedScope
in the framework code will delegate to this method to accumulate descriptions in a list.addToList(IEObjectDescription, List)
protected abstract java.util.List<IEObjectDescription> getLocalElementsByName(QualifiedName name)
getLocalElementsByName
in class AbstractScope
public java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
IScope
getElements
in interface IScope
getElements
in class AbstractScope
name
- the name of the to-be-found elements. May not be null
.name
. Never null
.protected java.lang.Iterable<IEObjectDescription> getLocalElementsByEObject(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.common.util.URI uri)
getLocalElementsByEObject
in class AbstractScope
protected java.lang.String getShadowingKey(IEObjectDescription description)
protected boolean isShadowed(IEObjectDescription fromParent)
AbstractScope
true
if the given description input
from the parent scope is
shadowed by local elements.isShadowed
in class AbstractScope
true
if the given description input
from the parent scope is
shadowed by local elements.