public abstract class AbstractFeatureScopeSession extends java.lang.Object implements IFeatureScopeSession
getId()
.
Requested scopes for other things that features are delegated
to the default scope provider
.
The concrete scope computation is performed by a utility
.ALL
Constructor and Description |
---|
AbstractFeatureScopeSession() |
Modifier and Type | Method and Description |
---|---|
protected void |
addExtensionProviders(java.util.List<ExpressionBucket> result) |
IFeatureScopeSession |
addImports(ITypeImporter.Client importer)
Add types to the session that are either imported statically or as extension.
|
IFeatureScopeSession |
addLocalElement(QualifiedName name,
JvmIdentifiableElement element,
ITypeReferenceOwner owner)
Add a locally defined identifiable to this scope.
|
protected void |
addLocalElements(java.util.List<IEObjectDescription> result) |
IFeatureScopeSession |
addLocalElements(java.util.Map<QualifiedName,JvmIdentifiableElement> elements,
ITypeReferenceOwner owner)
Add locally defined identifiables to this scope.
|
IFeatureScopeSession |
addNestedTypesToScope(JvmDeclaredType type)
Make inherited and declared nested classes of
type available by their simple names. |
IFeatureScopeSession |
addToExtensionScope(java.util.Map<XExpression,LightweightTypeReference> extensionProviders)
Add receivers to the session that contribute extensions.
|
IFeatureScopeSession |
addTypesToStaticScope(java.util.List<? extends JvmType> staticFeatureProviders,
java.util.List<? extends JvmType> extensionProviders)
Add types to the session that are imported statically either as plain static imports
or with an extension semantic.
|
IFeatureScopeSession |
captureLocalElements()
Allows to capture the available local elements as if they have been defined on the
this type as a member. |
protected IScope |
createConstructorScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
IResolvedTypes resolvedTypes) |
protected IScope |
createFeatureCallScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
IResolvedTypes resolvedTypes) |
protected IScope |
createTypeScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
IResolvedTypes resolvedTypes) |
IFeatureScopeSession |
dropLocalElements()
Allows to drop certain local elements from the current scope such as the enclosing
this
for static inner classes. |
protected abstract ConstructorScopes |
getConstructorScopes() |
protected abstract IScopeProvider |
getDefaultScopeProvider() |
java.util.List<JvmDeclaredType> |
getEnclosingTypes()
Returns a list of enclosing types that provide an instance in the current context.
|
java.util.List<ExpressionBucket> |
getExtensionProviders()
All extension providers as expression buckets.
|
protected abstract FeatureScopes |
getFeatureScopes() |
protected abstract int |
getId()
A simple means to identify the session.
|
java.util.List<IEObjectDescription> |
getLocalElements()
Return all local elements that are known in this session.
|
java.util.List<JvmDeclaredType> |
getNestedTypeDeclarators()
Returns enclosing types that declare available nested types.
|
IFeatureScopeSession |
getNextCaptureLayer()
Returns the next layer of the captured scopes.
|
protected abstract IResolvedFeatures.Provider |
getResolvedFeaturesProvider() |
IScope |
getScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference,
IResolvedTypes types)
Return the scope for the given
context and reference based on the
known resolved types . |
java.util.List<TypeBucket> |
getStaticallyImportedExtensionTypes()
All statically imported extension types as type buckets.
|
java.util.List<TypeBucket> |
getStaticallyImportedTypes()
All statically imported types as type buckets.
|
protected abstract TypeScopes |
getTypeScopes() |
IFeatureScopeSession |
toConstructorContext()
Forks this session with a constructor context.
|
IFeatureScopeSession |
toInstanceContext()
Forks this session with an instance context.
|
protected AbstractNestedFeatureScopeSession |
tryCreateNestedSessionWithVisibilityContext(java.util.Map<QualifiedName,JvmIdentifiableElement> elements,
ITypeReferenceOwner owner,
QualifiedName thisName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLocalElement, isConstructorContext, isInstanceContext, isVisible
isVisible
public IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, IResolvedTypes types)
IFeatureScopeSession
context
and reference
based on the
known resolved types
.getScope
in interface IFeatureScopeSession
context
- the context object. May not be null
.reference
- the reference that holds the unresolved proxy. May not be null
.types
- the already computed types.IScopeProvider.getScope(EObject, EReference)
public IFeatureScopeSession addTypesToStaticScope(java.util.List<? extends JvmType> staticFeatureProviders, java.util.List<? extends JvmType> extensionProviders)
IFeatureScopeSession
addTypesToStaticScope
in interface IFeatureScopeSession
staticFeatureProviders
- the static feature providers. May not be null
.extensionProviders
- the static extension providers. May not be null
.public IFeatureScopeSession addImports(ITypeImporter.Client importer)
IFeatureScopeSession
addImports
in interface IFeatureScopeSession
importer
- the description of the imported types.protected abstract IResolvedFeatures.Provider getResolvedFeaturesProvider()
protected abstract FeatureScopes getFeatureScopes()
protected abstract ConstructorScopes getConstructorScopes()
protected abstract TypeScopes getTypeScopes()
protected abstract IScopeProvider getDefaultScopeProvider()
protected abstract int getId()
public IFeatureScopeSession addToExtensionScope(java.util.Map<XExpression,LightweightTypeReference> extensionProviders)
IFeatureScopeSession
addToExtensionScope
in interface IFeatureScopeSession
extensionProviders
- the expressions that yield extension receivers.public IFeatureScopeSession addNestedTypesToScope(JvmDeclaredType type)
IFeatureScopeSession
type
available by their simple names.addNestedTypesToScope
in interface IFeatureScopeSession
public java.util.List<JvmDeclaredType> getEnclosingTypes()
IFeatureScopeSession
getEnclosingTypes
in interface IFeatureScopeSession
public java.util.List<JvmDeclaredType> getNestedTypeDeclarators()
IFeatureScopeSession
getNestedTypeDeclarators
in interface IFeatureScopeSession
public IFeatureScopeSession getNextCaptureLayer()
IFeatureScopeSession
getNextCaptureLayer
in interface IFeatureScopeSession
public IFeatureScopeSession toInstanceContext()
IFeatureScopeSession
toInstanceContext
in interface IFeatureScopeSession
IFeatureScopeSession.isInstanceContext()
public IFeatureScopeSession toConstructorContext()
IFeatureScopeSession
toConstructorContext
in interface IFeatureScopeSession
IFeatureScopeSession.isInstanceContext()
public IFeatureScopeSession dropLocalElements()
IFeatureScopeSession
this
for static inner classes.dropLocalElements
in interface IFeatureScopeSession
public IFeatureScopeSession captureLocalElements()
IFeatureScopeSession
this
type as a member.
This will provide a proper scope for non static nested or local classes.captureLocalElements
in interface IFeatureScopeSession
public IFeatureScopeSession addLocalElement(QualifiedName name, JvmIdentifiableElement element, ITypeReferenceOwner owner)
IFeatureScopeSession
addLocalElement
in interface IFeatureScopeSession
name
- the qualified name of the identifiable.element
- the element itself.public IFeatureScopeSession addLocalElements(java.util.Map<QualifiedName,JvmIdentifiableElement> elements, ITypeReferenceOwner owner)
IFeatureScopeSession
addLocalElements
in interface IFeatureScopeSession
elements
- the local elements.protected AbstractNestedFeatureScopeSession tryCreateNestedSessionWithVisibilityContext(java.util.Map<QualifiedName,JvmIdentifiableElement> elements, ITypeReferenceOwner owner, QualifiedName thisName)
protected IScope createFeatureCallScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, IResolvedTypes resolvedTypes)
protected IScope createConstructorScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, IResolvedTypes resolvedTypes)
protected IScope createTypeScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, IResolvedTypes resolvedTypes)
public java.util.List<IEObjectDescription> getLocalElements()
IFeatureScopeSession
getLocalElements
in interface IFeatureScopeSession
null
.protected void addLocalElements(java.util.List<IEObjectDescription> result)
result
- the list of all local elements. Shadowing semantics do not have to be applied.public java.util.List<TypeBucket> getStaticallyImportedTypes()
IFeatureScopeSession
getStaticallyImportedTypes
in interface IFeatureScopeSession
public java.util.List<TypeBucket> getStaticallyImportedExtensionTypes()
IFeatureScopeSession
getStaticallyImportedExtensionTypes
in interface IFeatureScopeSession
public java.util.List<ExpressionBucket> getExtensionProviders()
IFeatureScopeSession
getExtensionProviders
in interface IFeatureScopeSession
protected void addExtensionProviders(java.util.List<ExpressionBucket> result)
result
- an aggregating parameter that accepts the extension providers.