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 protectedResolvedTypeLiteral(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 voidapplyToComputationState()Apply this candidate to the current computation state model.protected java.util.List<XExpression>getArguments()protected LightweightTypeReferencegetDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter>getDeclaredTypeParameters()XAbstractFeatureCallgetFeatureCall()Returns the feature call that is linked.protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference>getPlainSyntacticTypeArguments()ILinkingCandidategetPreferredCandidate(ILinkingCandidate other)Produces the best candidate for the current two candidates.org.eclipse.xtext.common.types.JvmTypegetType()Returns the type that shall be resolved as a literal.java.util.List<LightweightTypeReference>getTypeArguments()The resolved type arguments.booleanisExtension()Returnstrueif the linked feature is contributed by an extension.booleanisPackageFragment()booleanisStatic()Returnstrueif the linked feature is static.booleanisTypeLiteral()Returnstrueif the feature call is linked as a type literal.protected voidpreApply()-
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:IFeatureLinkingCandidateReturns the feature call that is linked.- Specified by:
getFeatureCallin interfaceIFeatureLinkingCandidate- Returns:
- the feature call.
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is static.- Specified by:
isStaticin interfaceIFeatureLinkingCandidate- Specified by:
isStaticin interfaceITypeLiteralLinkingCandidate- Returns:
- always
false.
-
getType
public org.eclipse.xtext.common.types.JvmType getType()
Description copied from interface:ITypeLiteralLinkingCandidateReturns the type that shall be resolved as a literal.- Specified by:
getTypein interfaceITypeLiteralLinkingCandidate- Returns:
- the type.
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is contributed by an extension.- Specified by:
isExtensionin interfaceIFeatureLinkingCandidate- Specified by:
isExtensionin interfaceITypeLiteralLinkingCandidate- Returns:
- always
false.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the feature call is linked as a type literal.- Specified by:
isTypeLiteralin interfaceIFeatureLinkingCandidate- Specified by:
isTypeLiteralin interfaceITypeLiteralLinkingCandidate- Overrides:
isTypeLiteralin classAbstractLinkingCandidate<XAbstractFeatureCall>- Returns:
- always
true.
-
isPackageFragment
public boolean isPackageFragment()
-
getArguments
protected java.util.List<XExpression> getArguments()
- Specified by:
getArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getTypeArguments
public java.util.List<LightweightTypeReference> getTypeArguments()
Description copied from interface:ILinkingCandidateThe resolved type arguments.- Specified by:
getTypeArgumentsin interfaceILinkingCandidate- Specified by:
getTypeArgumentsin interfaceITypeLiteralLinkingCandidate- Overrides:
getTypeArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>- Returns:
- an empty list.
-
getPlainSyntacticTypeArguments
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> getPlainSyntacticTypeArguments()
- Specified by:
getPlainSyntacticTypeArgumentsin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredTypeParameters
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
- Overrides:
getDeclaredTypeParametersin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getPreferredCandidate
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
Description copied from interface:ILinkingCandidateProduces the best candidate for the current two candidates. It may turn out that both candidates (thisandother) 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:
getPreferredCandidatein interfaceILinkingCandidate
-
applyToComputationState
public void applyToComputationState()
Description copied from interface:ILinkingCandidateApply 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:
applyToComputationStatein interfaceILinkingCandidate- Overrides:
applyToComputationStatein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
preApply
protected void preApply()
- Overrides:
preApplyin classAbstractLinkingCandidate<XAbstractFeatureCall>
-
getDeclaredType
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
- Overrides:
getDeclaredTypein classAbstractLinkingCandidate<XAbstractFeatureCall>
-
-