Class IResolvedTypes.NullResolvedTypes
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.IResolvedTypes.NullResolvedTypes
-
- All Implemented Interfaces:
IResolvedTypes
- Enclosing interface:
- IResolvedTypes
public static class IResolvedTypes.NullResolvedTypes extends java.lang.Object implements IResolvedTypes
- Noextend:
- This class is not intended to be subclassed by clients.
- Noinstantiate:
- This class is not intended to be instantiated by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.xbase.typesystem.IResolvedTypes
IResolvedTypes.NullResolvedTypes
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.xbase.typesystem.IResolvedTypes
NULL
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNullResolvedTypes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LightweightTypeReferencegetActualType(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)Returns the actually inferred or declared type for the given identifiable ornullif none.LightweightTypeReferencegetActualType(XExpression expression)Returns the actually inferred type for the given expression ornullif none.java.util.List<LightweightTypeReference>getActualTypeArguments(XExpression expression)Returns the resolved type arguments.java.util.Collection<IAmbiguousLinkingCandidate>getAmbiguousLinkingCandidates()Returns all ambiguous linking candidates that have been encountered.LightweightTypeReferencegetExpectedReturnType(XExpression expression)Returns the expected return type for the given expression ornullif none.LightweightTypeReferencegetExpectedType(XExpression expression)Returns the actually expected type for the given expression ornullif none.IExpressionScopegetExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)Returns the scope the given expression is contained in.java.util.Collection<ILinkingCandidate>getFollowUpErrors()Returns the linking candidates that could not be resolved but are not exposed to the users because they are follow up errors.org.eclipse.xtext.common.types.JvmIdentifiableElementgetLinkedFeature(XAbstractFeatureCall featureCall)Returns the intermediate linking result for the given feature call, if any.org.eclipse.xtext.common.types.JvmIdentifiableElementgetLinkedFeature(XConstructorCall constructorCall)Returns the intermediate linking result for the given constructor call, if any.IFeatureLinkingCandidategetLinkingCandidate(XAbstractFeatureCall featureCall)Returns the intermediate linking candidate for the given feature call, if any.IConstructorLinkingCandidategetLinkingCandidate(XConstructorCall constructorCall)Returns the intermediate linking candidate for the given constructor call, if any.java.util.Collection<org.eclipse.xtext.diagnostics.AbstractDiagnostic>getQueuedDiagnostics()Provides access to all diagnostics that have been added during the type computation so far.LightweightTypeReferencegetReturnType(XExpression expression)Returns the actually inferred return type for the given expression ornullif none.LightweightTypeReferencegetReturnType(XExpression expression, boolean onlyExplicitReturn)Returns the actually inferred return type for the given expression ornullif none.java.util.List<LightweightTypeReference>getThrownExceptions(XExpression obj)booleanhasExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)booleanisRefinedType(XExpression expression)Returnstrueif the expression's type is based on a type refinement, e.g.booleanisVoidTypeAllowed(XExpression expression)Returnstrueif the given expression may have the typevoid.
-
-
-
Method Detail
-
getQueuedDiagnostics
public java.util.Collection<org.eclipse.xtext.diagnostics.AbstractDiagnostic> getQueuedDiagnostics()
Description copied from interface:IResolvedTypesProvides access to all diagnostics that have been added during the type computation so far.- Specified by:
getQueuedDiagnosticsin interfaceIResolvedTypes
-
getFollowUpErrors
public java.util.Collection<ILinkingCandidate> getFollowUpErrors()
Description copied from interface:IResolvedTypesReturns the linking candidates that could not be resolved but are not exposed to the users because they are follow up errors.- Specified by:
getFollowUpErrorsin interfaceIResolvedTypes
-
getAmbiguousLinkingCandidates
public java.util.Collection<IAmbiguousLinkingCandidate> getAmbiguousLinkingCandidates()
Description copied from interface:IResolvedTypesReturns all ambiguous linking candidates that have been encountered.- Specified by:
getAmbiguousLinkingCandidatesin interfaceIResolvedTypes
-
getExpectedType
public LightweightTypeReference getExpectedType(XExpression expression)
Description copied from interface:IResolvedTypesReturns the actually expected type for the given expression ornullif none.- Specified by:
getExpectedTypein interfaceIResolvedTypes- Parameters:
expression- expression whose expected type is queried.
-
getExpectedReturnType
public LightweightTypeReference getExpectedReturnType(XExpression expression)
Description copied from interface:IResolvedTypesReturns the expected return type for the given expression ornullif none.- Specified by:
getExpectedReturnTypein interfaceIResolvedTypes- Parameters:
expression- expression whose expected return type is queried.
-
getActualTypeArguments
public java.util.List<LightweightTypeReference> getActualTypeArguments(XExpression expression)
Description copied from interface:IResolvedTypesReturns the resolved type arguments. If the expression refers to a constructor and the constructor itself defines type parameters, their resolved representation is prepended to the list of type arguments. Consider the following type:class C<T, V> { public <PLgt; C(P p) {} }An invocation of the constructorCwill return three type arguments, the bound values of forP,TandV.- Specified by:
getActualTypeArgumentsin interfaceIResolvedTypes- Parameters:
expression- may either be anXAbstractFeatureCallorXConstructorCall. May not benull.
-
getThrownExceptions
public java.util.List<LightweightTypeReference> getThrownExceptions(XExpression obj)
- Specified by:
getThrownExceptionsin interfaceIResolvedTypes
-
getActualType
public LightweightTypeReference getActualType(XExpression expression)
Description copied from interface:IResolvedTypesReturns the actually inferred type for the given expression ornullif none.- Specified by:
getActualTypein interfaceIResolvedTypes- Parameters:
expression- expression whose type is queried.
-
getReturnType
public LightweightTypeReference getReturnType(XExpression expression)
Description copied from interface:IResolvedTypesReturns the actually inferred return type for the given expression ornullif none. Returns the actual expression type, if no explicit return type exists. Shorthand forgetReturnType(expression, false)- Specified by:
getReturnTypein interfaceIResolvedTypes- Parameters:
expression- expression whose return type is queried.
-
getReturnType
public LightweightTypeReference getReturnType(XExpression expression, boolean onlyExplicitReturn)
Description copied from interface:IResolvedTypesReturns the actually inferred return type for the given expression ornullif none.- Specified by:
getReturnTypein interfaceIResolvedTypes- Parameters:
expression- expression whose return type is queried.
-
getActualType
public LightweightTypeReference getActualType(org.eclipse.xtext.common.types.JvmIdentifiableElement identifiable)
Description copied from interface:IResolvedTypesReturns the actually inferred or declared type for the given identifiable ornullif none.- Specified by:
getActualTypein interfaceIResolvedTypes- Parameters:
identifiable- identifiable whose type is queried.
-
isVoidTypeAllowed
public boolean isVoidTypeAllowed(XExpression expression)
Description copied from interface:IResolvedTypesReturnstrueif the given expression may have the typevoid.- Specified by:
isVoidTypeAllowedin interfaceIResolvedTypes- Parameters:
expression- expression whose expected type is queried.
-
getLinkedFeature
public org.eclipse.xtext.common.types.JvmIdentifiableElement getLinkedFeature(XAbstractFeatureCall featureCall)
Description copied from interface:IResolvedTypesReturns the intermediate linking result for the given feature call, if any. If the feature call isnull, the result isnull.- Specified by:
getLinkedFeaturein interfaceIResolvedTypes- Parameters:
featureCall- the feature call that is queried for the current linking state.- Returns:
- the potentially intermediate linking state or
nullif none.
-
getLinkingCandidate
public IFeatureLinkingCandidate getLinkingCandidate(XAbstractFeatureCall featureCall)
Description copied from interface:IResolvedTypesReturns the intermediate linking candidate for the given feature call, if any. If the feature call isnull, the result isnull.- Specified by:
getLinkingCandidatein interfaceIResolvedTypes- Parameters:
featureCall- the feature call that is queried for the current linking state.- Returns:
- the potentially intermediate linking state or
nullif none.
-
getLinkedFeature
public org.eclipse.xtext.common.types.JvmIdentifiableElement getLinkedFeature(XConstructorCall constructorCall)
Description copied from interface:IResolvedTypesReturns the intermediate linking result for the given constructor call, if any. If the constructor call isnull, the result isnull. If the constructor call is broken, it may return aJvmTypeinstead of aJvmConstructor.- Specified by:
getLinkedFeaturein interfaceIResolvedTypes- Parameters:
constructorCall- the constructor call that is queried for the current linking state.- Returns:
- the potentially intermediate linking state or
nullif none.
-
getLinkingCandidate
public IConstructorLinkingCandidate getLinkingCandidate(XConstructorCall constructorCall)
Description copied from interface:IResolvedTypesReturns the intermediate linking candidate for the given constructor call, if any. If the constructor call isnull, the result isnull. If the constructor call is broken, it may return aJvmTypeinstead of aJvmConstructor.- Specified by:
getLinkingCandidatein interfaceIResolvedTypes- Parameters:
constructorCall- the constructor call that is queried for the current linking state.- Returns:
- the potentially intermediate linking state or
nullif none.
-
isRefinedType
public boolean isRefinedType(XExpression expression)
Description copied from interface:IResolvedTypesReturnstrueif the expression's type is based on a type refinement, e.g. an instanceof guard my specialize the type of the checked reference. Any feature call to that reference is considered to be based on a refined type.- Specified by:
isRefinedTypein interfaceIResolvedTypes- Parameters:
expression- the expression that may have been typed based on a refinement.- Returns:
trueif the type was refined,falseotherwise.
-
getExpressionScope
public IExpressionScope getExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)
Description copied from interface:IResolvedTypesReturns the scope the given expression is contained in. This considers all decision paths that were taken while computing the type of the expression. The returned scope carries some meta data such as whether there was an attempt to resolve the given expression as a type.- Specified by:
getExpressionScopein interfaceIResolvedTypes
-
hasExpressionScope
public boolean hasExpressionScope(org.eclipse.emf.ecore.EObject context, IExpressionScope.Anchor anchor)- Specified by:
hasExpressionScopein interfaceIResolvedTypes
-
-