Class ResolvedTypeLiteral
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate<Expression>
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference<XAbstractFeatureCall>
-
- org.eclipse.xtext.xbase.typesystem.internal.ResolvedTypeLiteral
-
- All Implemented Interfaces:
IApplicableCandidate
,IFeatureLinkingCandidate
,ILinkingCandidate
,ITypeLiteralLinkingCandidate
public class ResolvedTypeLiteral extends AbstractResolvedReference<XAbstractFeatureCall> implements ITypeLiteralLinkingCandidate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
AbstractLinkingCandidate.ArgumentTypeComputationState, AbstractLinkingCandidate.ObservableTypeExpectation
-
-
Field Summary
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference
resolvedElement
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
arguments, typeArguments
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResolvedTypeLiteral(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedElement, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyToComputationState()
Apply this candidate to the current computation state model.protected java.util.List<XExpression>
getArguments()
protected LightweightTypeReference
getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter>
getDeclaredTypeParameters()
XAbstractFeatureCall
getFeatureCall()
Returns the feature call that is linked.protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference>
getPlainSyntacticTypeArguments()
ILinkingCandidate
getPreferredCandidate(ILinkingCandidate other)
Produces the best candidate for the current two candidates.org.eclipse.xtext.common.types.JvmType
getType()
Returns the type that shall be resolved as a literal.java.util.List<LightweightTypeReference>
getTypeArguments()
The resolved type arguments.boolean
isExtension()
Returnstrue
if the linked feature is contributed by an extension.boolean
isPackageFragment()
boolean
isStatic()
Returnstrue
if the linked feature is static.boolean
isTypeLiteral()
Returnstrue
if the feature call is linked as a type literal.protected void
preApply()
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractResolvedReference
applyToModel, getFeature, getTypeParameterMapping, toString, validate
-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractLinkingCandidate
accept, computeArgumentType, computeArgumentTypes, computeFixedArityArgumentType, computeVarArgumentType, createArgumentTypeSubstitutor, createLinkingTypeComputationState, createVarArgTypeComputationState, deferredBindTypeArgument, discardRefinementTypeIfReassigned, getActualType, getActualType, getDeclaratorParameterMapping, getExpectedType, getExpression, getState, getSubstitutedExpectedType, getSyntacticTypeArguments, hasReceiver, initializeArgumentTypeComputation, initializeConstraintMapping, initializeMapping, initializeTypeParameterMapping, initializeTypeParameterMapping, isBoundTypeArgumentSkipped, isRawTypeContext, mustDiscardRefinement, resolveAgainstActualType, resolveArgumentType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.computation.IApplicableCandidate
validate
-
Methods inherited from interface org.eclipse.xtext.xbase.typesystem.computation.ILinkingCandidate
applyToModel, getExpression, getFeature
-
-
-
-
Constructor Detail
-
ResolvedTypeLiteral
protected ResolvedTypeLiteral(XAbstractFeatureCall featureCall, org.eclipse.xtext.common.types.JvmIdentifiableElement resolvedElement, ITypeExpectation expectation, ExpressionTypeComputationState state)
-
-
Method Detail
-
getFeatureCall
public XAbstractFeatureCall getFeatureCall()
Description copied from interface:IFeatureLinkingCandidate
Returns the feature call that is linked.- Specified by:
getFeatureCall
in interfaceIFeatureLinkingCandidate
- Returns:
- the feature call.
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the linked feature is static.- Specified by:
isStatic
in interfaceIFeatureLinkingCandidate
- Specified by:
isStatic
in interfaceITypeLiteralLinkingCandidate
- Returns:
- always
false
.
-
getType
public org.eclipse.xtext.common.types.JvmType getType()
Description copied from interface:ITypeLiteralLinkingCandidate
Returns the type that shall be resolved as a literal.- Specified by:
getType
in interfaceITypeLiteralLinkingCandidate
- Returns:
- the type.
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the linked feature is contributed by an extension.- Specified by:
isExtension
in interfaceIFeatureLinkingCandidate
- Specified by:
isExtension
in interfaceITypeLiteralLinkingCandidate
- Returns:
- always
false
.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the feature call is linked as a type literal.- Specified by:
isTypeLiteral
in interfaceIFeatureLinkingCandidate
- Specified by:
isTypeLiteral
in interfaceITypeLiteralLinkingCandidate
- Overrides:
isTypeLiteral
in classAbstractLinkingCandidate<XAbstractFeatureCall>
- Returns:
- always
true
.
-
isPackageFragment
public boolean isPackageFragment()
-
getArguments
protected java.util.List<XExpression> getArguments()
- Specified by:
getArguments
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getTypeArguments
public java.util.List<LightweightTypeReference> getTypeArguments()
Description copied from interface:ILinkingCandidate
The resolved type arguments.- Specified by:
getTypeArguments
in interfaceILinkingCandidate
- Specified by:
getTypeArguments
in interfaceITypeLiteralLinkingCandidate
- Overrides:
getTypeArguments
in classAbstractLinkingCandidate<XAbstractFeatureCall>
- Returns:
- an empty list.
-
getPlainSyntacticTypeArguments
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> getPlainSyntacticTypeArguments()
- Specified by:
getPlainSyntacticTypeArguments
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredTypeParameters
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
- Overrides:
getDeclaredTypeParameters
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getPreferredCandidate
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
Description copied from interface:ILinkingCandidate
Produces the best candidate for the current two candidates. It may turn out that both candidates (this
andother
) are ambiguous so no prefered candidate can be chosen. In that case, a new linking candidate may be produced that carries this information and will use that onILinkingCandidate.applyToComputationState()
,ILinkingCandidate.applyToModel(IResolvedTypes)
, andIApplicableCandidate.validate(IAcceptor)
.- Specified by:
getPreferredCandidate
in interfaceILinkingCandidate
-
applyToComputationState
public void applyToComputationState()
Description copied from interface:ILinkingCandidate
Apply this candidate to the current computation state model. This propagates the type information about arguments and child expressions to the currently active resolution state.- Specified by:
applyToComputationState
in interfaceILinkingCandidate
- Overrides:
applyToComputationState
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
preApply
protected void preApply()
- Overrides:
preApply
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredType
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
- Overrides:
getDeclaredType
in classAbstractLinkingCandidate<XAbstractFeatureCall>
-
-