Class RootFeatureScopeSession
- java.lang.Object
-
- org.eclipse.xtext.xbase.scoping.batch.AbstractFeatureScopeSession
-
- org.eclipse.xtext.xbase.scoping.batch.RootFeatureScopeSession
-
- All Implemented Interfaces:
IFeatureScopeSession,IVisibilityHelper
public class RootFeatureScopeSession extends AbstractFeatureScopeSession
The root session. It is save to be used by various child sessions since it will never return something except empty lists.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.xbase.typesystem.util.IVisibilityHelper
ALL
-
-
Constructor Summary
Constructors Constructor Description RootFeatureScopeSession()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConstructorScopesgetConstructorScopes()protected org.eclipse.xtext.scoping.IScopeProvidergetDefaultScopeProvider()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.resource.IEObjectDescription>getLocalElements()Return all local elements that are known in this session.protected IResolvedFeatures.ProvidergetResolvedFeaturesProvider()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
addExtensionProviders, addImports, addLocalElement, addLocalElements, addLocalElements, addNestedTypesToScope, addToExtensionScope, addTypesToStaticScope, captureLocalElements, createConstructorScope, createFeatureCallScope, createTypeScope, dropLocalElements, getEnclosingTypes, getExtensionProviders, getNestedTypeDeclarators, getNextCaptureLayer, getScope, getStaticallyImportedExtensionTypes, getStaticallyImportedTypes, toConstructorContext, toInstanceContext, tryCreateNestedSessionWithVisibilityContext
-
-
-
-
Method Detail
-
getFeatureScopes
protected FeatureScopes getFeatureScopes()
- Specified by:
getFeatureScopesin classAbstractFeatureScopeSession
-
getResolvedFeaturesProvider
protected IResolvedFeatures.Provider getResolvedFeaturesProvider()
- Specified by:
getResolvedFeaturesProviderin classAbstractFeatureScopeSession
-
getTypeScopes
protected TypeScopes getTypeScopes()
- Specified by:
getTypeScopesin classAbstractFeatureScopeSession
-
getConstructorScopes
protected ConstructorScopes getConstructorScopes()
- Specified by:
getConstructorScopesin classAbstractFeatureScopeSession
-
getDefaultScopeProvider
protected org.eclipse.xtext.scoping.IScopeProvider getDefaultScopeProvider()
- Specified by:
getDefaultScopeProviderin 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.
-
getLocalElements
public java.util.List<org.eclipse.xtext.resource.IEObjectDescription> getLocalElements()
Description copied from interface:IFeatureScopeSessionReturn all local elements that are known in this session.- Specified by:
getLocalElementsin interfaceIFeatureScopeSession- Overrides:
getLocalElementsin classAbstractFeatureScopeSession- Returns:
- all local elements. Never
null.
-
getId
protected int getId()
Description copied from class:AbstractFeatureScopeSessionA simple means to identify the session.- Specified by:
getIdin classAbstractFeatureScopeSession
-
isInstanceContext
public boolean isInstanceContext()
Returnstrueifthiscan be validly resolved in the current scope. By default, a session is not an instance context.- See Also:
IFeatureScopeSession.toInstanceContext()
-
isConstructorContext
public boolean isConstructorContext()
Returnstrueif the current expression is used in a constructor body. By default, a session is not a constructor context.
-
isVisible
public boolean isVisible(org.eclipse.xtext.common.types.JvmMember member)
Returnstrueif the member is visible according to theJvmVisibilityand the local context. By default, all public features are considered to be accessible.- 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)Returnstrueif the member is visible according to theJvmVisibilityand the local context when invoked on the given receiver feature which resolves to the given type. By default, all public features are considered to be accessible.- 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.
-
-