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 ConstructorScopes
getConstructorScopes()
protected org.eclipse.xtext.scoping.IScopeProvider
getDefaultScopeProvider()
protected FeatureScopes
getFeatureScopes()
protected int
getId()
A simple means to identify the session.org.eclipse.xtext.resource.IEObjectDescription
getLocalElement(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.Provider
getResolvedFeaturesProvider()
protected TypeScopes
getTypeScopes()
boolean
isConstructorContext()
Returnstrue
if the current expression is used in a constructor body.boolean
isInstanceContext()
Returnstrue
ifthis
can be validly resolved in the current scope.boolean
isVisible(org.eclipse.xtext.common.types.JvmMember member)
Returnstrue
if the member is visible according to theJvmVisibility
and the local context.boolean
isVisible(org.eclipse.xtext.common.types.JvmMember member, LightweightTypeReference receiverType, org.eclipse.xtext.common.types.JvmIdentifiableElement receiverFeature)
Returnstrue
if the member is visible according to theJvmVisibility
and 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:
getFeatureScopes
in classAbstractFeatureScopeSession
-
getResolvedFeaturesProvider
protected IResolvedFeatures.Provider getResolvedFeaturesProvider()
- Specified by:
getResolvedFeaturesProvider
in classAbstractFeatureScopeSession
-
getTypeScopes
protected TypeScopes getTypeScopes()
- Specified by:
getTypeScopes
in classAbstractFeatureScopeSession
-
getConstructorScopes
protected ConstructorScopes getConstructorScopes()
- Specified by:
getConstructorScopes
in classAbstractFeatureScopeSession
-
getDefaultScopeProvider
protected org.eclipse.xtext.scoping.IScopeProvider getDefaultScopeProvider()
- Specified by:
getDefaultScopeProvider
in classAbstractFeatureScopeSession
-
getLocalElement
public org.eclipse.xtext.resource.IEObjectDescription getLocalElement(org.eclipse.xtext.naming.QualifiedName name)
Description copied from interface:IFeatureScopeSession
Find 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:IFeatureScopeSession
Return all local elements that are known in this session.- Specified by:
getLocalElements
in interfaceIFeatureScopeSession
- Overrides:
getLocalElements
in classAbstractFeatureScopeSession
- Returns:
- all local elements. Never
null
.
-
getId
protected int getId()
Description copied from class:AbstractFeatureScopeSession
A simple means to identify the session.- Specified by:
getId
in classAbstractFeatureScopeSession
-
isInstanceContext
public boolean isInstanceContext()
Returnstrue
ifthis
can be validly resolved in the current scope. By default, a session is not an instance context.- See Also:
IFeatureScopeSession.toInstanceContext()
-
isConstructorContext
public boolean isConstructorContext()
Returnstrue
if 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)
Returnstrue
if the member is visible according to theJvmVisibility
and the local context. By default, all public features are considered to be accessible.- Parameters:
member
- the member that shall be accessed.- Returns:
true
if 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)
Returnstrue
if the member is visible according to theJvmVisibility
and 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:
true
if the feature can be accessed.
-
-