public interface IFeatureScopeSession extends IVisibilityHelper
IScope
by means of
getScope(EObject, EReference, IResolvedTypes)
.ALL
Modifier and Type | Method and Description |
---|---|
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.
|
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> staticExtensionProviders)
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. |
IFeatureScopeSession |
dropLocalElements()
Allows to drop certain local elements from the current scope such as the enclosing
this
for static inner classes. |
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.
|
IEObjectDescription |
getLocalElement(QualifiedName name)
Find a local element with the given qualified name.
|
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.
|
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.
|
boolean |
isConstructorContext()
Returns
true if the current expression is used in a constructor body. |
boolean |
isInstanceContext()
Returns
true if this can be validly resolved in the current scope. |
boolean |
isVisible(JvmMember member,
LightweightTypeReference receiverType,
JvmIdentifiableElement receiverFeature)
Returns
true if the member is visible according to the JvmVisibility and the local context
when invoked on the given receiver feature which resolves to the given type. |
IFeatureScopeSession |
toConstructorContext()
Forks this session with a constructor context.
|
IFeatureScopeSession |
toInstanceContext()
Forks this session with an instance context.
|
isVisible
IScope getScope(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference reference, IResolvedTypes types)
context
and reference
based on the
known resolved types
.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)
IFeatureScopeSession addTypesToStaticScope(java.util.List<? extends JvmType> staticFeatureProviders, java.util.List<? extends JvmType> staticExtensionProviders)
staticFeatureProviders
- the static feature providers. May not be null
.staticExtensionProviders
- the static extension providers. May not be null
.IFeatureScopeSession addImports(ITypeImporter.Client importer)
importer
- the description of the imported types.IFeatureScopeSession addToExtensionScope(java.util.Map<XExpression,LightweightTypeReference> extensionProviders)
extensionProviders
- the expressions that yield extension receivers.IFeatureScopeSession addNestedTypesToScope(JvmDeclaredType type)
type
available by their simple names.java.util.List<JvmDeclaredType> getEnclosingTypes()
java.util.List<JvmDeclaredType> getNestedTypeDeclarators()
IFeatureScopeSession toInstanceContext()
isInstanceContext()
IFeatureScopeSession toConstructorContext()
isInstanceContext()
boolean isInstanceContext()
true
if this
can be validly resolved in the current scope.toInstanceContext()
boolean isConstructorContext()
true
if the current expression is used in a constructor body.toConstructorContext()
java.util.List<ExpressionBucket> getExtensionProviders()
IFeatureScopeSession addLocalElement(QualifiedName name, JvmIdentifiableElement element, ITypeReferenceOwner owner)
name
- the qualified name of the identifiable.element
- the element itself.IFeatureScopeSession addLocalElements(java.util.Map<QualifiedName,JvmIdentifiableElement> elements, ITypeReferenceOwner owner)
elements
- the local elements.IFeatureScopeSession dropLocalElements()
this
for static inner classes.IFeatureScopeSession captureLocalElements()
this
type as a member.
This will provide a proper scope for non static nested or local classes.IFeatureScopeSession getNextCaptureLayer()
IEObjectDescription getLocalElement(QualifiedName name)
null
.java.util.List<IEObjectDescription> getLocalElements()
null
.java.util.List<TypeBucket> getStaticallyImportedTypes()
java.util.List<TypeBucket> getStaticallyImportedExtensionTypes()
boolean isVisible(JvmMember member, LightweightTypeReference receiverType, JvmIdentifiableElement receiverFeature)
true
if the member is visible according to the JvmVisibility
and the local context
when invoked on the given receiver feature which resolves to the given type.member
- the member that shall be accessed.receiverType
- the type of the receiver. May be unknown.receiverFeature
- the links the receiver of the feature call to the given member. May be unknown.true
if the feature can be accessed.