Class AbstractNestedFeatureScopeSession
- java.lang.Object
-
- org.eclipse.xtext.xbase.scoping.batch.AbstractFeatureScopeSession
-
- org.eclipse.xtext.xbase.scoping.batch.AbstractNestedFeatureScopeSession
-
- All Implemented Interfaces:
IFeatureScopeSession,IVisibilityHelper
- Direct Known Subclasses:
ConstructorFeatureScopeSession,FeatureScopeSessionWithCapturedLocalElements,FeatureScopeSessionWithContext,FeatureScopeSessionWithDynamicExtensions,FeatureScopeSessionWithLocalElements,FeatureScopeSessionWithNamedStaticTypes,FeatureScopeSessionWithNestedTypes,FeatureScopeSessionWithoutLocalElements,FeatureScopeSessionWithStaticTypes,InstanceFeatureScopeSession
public abstract class AbstractNestedFeatureScopeSession extends AbstractFeatureScopeSession
An abstract nested feature scope session. Delegates all queries to its parent.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.xbase.typesystem.util.IVisibilityHelper
ALL
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNestedFeatureScopeSession(AbstractFeatureScopeSession parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExtensionProviders(java.util.List<ExpressionBucket> result)protected voidaddLocalElements(java.util.List<org.eclipse.xtext.resource.IEObjectDescription> result)protected ConstructorScopesgetConstructorScopes()protected org.eclipse.xtext.scoping.IScopeProvidergetDefaultScopeProvider()java.util.List<org.eclipse.xtext.common.types.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 FeatureScopesgetFeatureScopes()protected intgetId()A simple means to identify the session.org.eclipse.xtext.resource.IEObjectDescriptiongetLocalElement(org.eclipse.xtext.naming.QualifiedName name)Find a local element with the given qualified name.java.util.List<org.eclipse.xtext.common.types.JvmDeclaredType>getNestedTypeDeclarators()Returns enclosing types that declare available nested types.IFeatureScopeSessiongetNextCaptureLayer()Returns the next layer of the captured scopes.protected AbstractFeatureScopeSessiongetParent()protected IResolvedFeatures.ProvidergetResolvedFeaturesProvider()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 TypeScopesgetTypeScopes()booleanisConstructorContext()Returnstrueif the current expression is used in a constructor body.booleanisInstanceContext()Returnstrueifthiscan be validly resolved in the current scope.booleanisVisible(org.eclipse.xtext.common.types.JvmMember member)Returnstrueif the member is visible according to theJvmVisibilityand the local context.booleanisVisible(org.eclipse.xtext.common.types.JvmMember member, LightweightTypeReference receiverType, org.eclipse.xtext.common.types.JvmIdentifiableElement receiverFeature)Returnstrueif the member is visible according to theJvmVisibilityand the local context when invoked on the given receiver feature which resolves to the given type.-
Methods inherited from class org.eclipse.xtext.xbase.scoping.batch.AbstractFeatureScopeSession
addImports, addLocalElement, addLocalElements, addNestedTypesToScope, addToExtensionScope, addTypesToStaticScope, captureLocalElements, createConstructorScope, createFeatureCallScope, createTypeScope, dropLocalElements, getLocalElements, getScope, toConstructorContext, toInstanceContext, tryCreateNestedSessionWithVisibilityContext
-
-
-
-
Constructor Detail
-
AbstractNestedFeatureScopeSession
protected AbstractNestedFeatureScopeSession(AbstractFeatureScopeSession parent)
-
-
Method Detail
-
getDefaultScopeProvider
protected org.eclipse.xtext.scoping.IScopeProvider getDefaultScopeProvider()
- Specified by:
getDefaultScopeProviderin classAbstractFeatureScopeSession
-
getFeatureScopes
protected FeatureScopes getFeatureScopes()
- Specified by:
getFeatureScopesin classAbstractFeatureScopeSession
-
getResolvedFeaturesProvider
protected IResolvedFeatures.Provider getResolvedFeaturesProvider()
- Specified by:
getResolvedFeaturesProviderin classAbstractFeatureScopeSession
-
getConstructorScopes
protected ConstructorScopes getConstructorScopes()
- Specified by:
getConstructorScopesin classAbstractFeatureScopeSession
-
getTypeScopes
protected TypeScopes getTypeScopes()
- Specified by:
getTypeScopesin classAbstractFeatureScopeSession
-
getParent
protected AbstractFeatureScopeSession getParent()
-
getNextCaptureLayer
public IFeatureScopeSession getNextCaptureLayer()
Description copied from interface:IFeatureScopeSessionReturns the next layer of the captured scopes.- Specified by:
getNextCaptureLayerin interfaceIFeatureScopeSession- Overrides:
getNextCaptureLayerin classAbstractFeatureScopeSession
-
getEnclosingTypes
public java.util.List<org.eclipse.xtext.common.types.JvmDeclaredType> getEnclosingTypes()
Description copied from interface:IFeatureScopeSessionReturns a list of enclosing types that provide an instance in the current context. The first element in the list is the innermost type.- Specified by:
getEnclosingTypesin interfaceIFeatureScopeSession- Overrides:
getEnclosingTypesin classAbstractFeatureScopeSession
-
getNestedTypeDeclarators
public java.util.List<org.eclipse.xtext.common.types.JvmDeclaredType> getNestedTypeDeclarators()
Description copied from interface:IFeatureScopeSessionReturns enclosing types that declare available nested types. The first element in the list is the innermost type.- Specified by:
getNestedTypeDeclaratorsin interfaceIFeatureScopeSession- Overrides:
getNestedTypeDeclaratorsin classAbstractFeatureScopeSession
-
getLocalElement
public org.eclipse.xtext.resource.IEObjectDescription getLocalElement(org.eclipse.xtext.naming.QualifiedName name)
Description copied from interface:IFeatureScopeSessionFind a local element with the given qualified name.- Returns:
- the known element or
null.
-
addLocalElements
protected void addLocalElements(java.util.List<org.eclipse.xtext.resource.IEObjectDescription> result)
- Overrides:
addLocalElementsin classAbstractFeatureScopeSession- Parameters:
result- the list of all local elements. Shadowing semantics do not have to be applied.
-
getStaticallyImportedTypes
public java.util.List<TypeBucket> getStaticallyImportedTypes()
Description copied from interface:IFeatureScopeSessionAll statically imported types as type buckets. The list has usually two elements:- The implicitly imported types as a single bucket.
- The explicitly imported types as a single bucket.
- Specified by:
getStaticallyImportedTypesin interfaceIFeatureScopeSession- Overrides:
getStaticallyImportedTypesin classAbstractFeatureScopeSession
-
getStaticallyImportedExtensionTypes
public java.util.List<TypeBucket> getStaticallyImportedExtensionTypes()
Description copied from interface:IFeatureScopeSessionAll statically imported extension types as type buckets. The list has usually two elements:- The implicitly available extensions as a single bucket.
- The explicitly imported extensions as a single bucket.
- Specified by:
getStaticallyImportedExtensionTypesin interfaceIFeatureScopeSession- Overrides:
getStaticallyImportedExtensionTypesin classAbstractFeatureScopeSession
-
getExtensionProviders
public java.util.List<ExpressionBucket> getExtensionProviders()
Description copied from interface:IFeatureScopeSessionAll extension providers as expression buckets.- Specified by:
getExtensionProvidersin interfaceIFeatureScopeSession- Overrides:
getExtensionProvidersin classAbstractFeatureScopeSession- Returns:
- the list of extension providers.
-
isInstanceContext
public boolean isInstanceContext()
Description copied from interface:IFeatureScopeSessionReturnstrueifthiscan be validly resolved in the current scope.- See Also:
IFeatureScopeSession.toInstanceContext()
-
isConstructorContext
public boolean isConstructorContext()
Description copied from interface:IFeatureScopeSessionReturnstrueif the current expression is used in a constructor body.
-
addExtensionProviders
protected void addExtensionProviders(java.util.List<ExpressionBucket> result)
- Overrides:
addExtensionProvidersin classAbstractFeatureScopeSession- Parameters:
result- an aggregating parameter that accepts the extension providers.
-
getId
protected int getId()
Description copied from class:AbstractFeatureScopeSessionA simple means to identify the session.- Specified by:
getIdin classAbstractFeatureScopeSession
-
isVisible
public boolean isVisible(org.eclipse.xtext.common.types.JvmMember member)
Description copied from interface:IVisibilityHelperReturnstrueif the member is visible according to theJvmVisibilityand the local context.- Parameters:
member- the member that shall be accessed.- Returns:
trueif the feature can be accessed.
-
isVisible
public boolean isVisible(org.eclipse.xtext.common.types.JvmMember member, LightweightTypeReference receiverType, org.eclipse.xtext.common.types.JvmIdentifiableElement receiverFeature)Description copied from interface:IFeatureScopeSessionReturnstrueif the member is visible according to theJvmVisibilityand the local context when invoked on the given receiver feature which resolves to the given type.- Parameters:
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.- Returns:
trueif the feature can be accessed.
-
-