Class NullFeatureLinkingCandidate
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractNullLinkingCandidate
-
- org.eclipse.xtext.xbase.typesystem.internal.NullFeatureLinkingCandidate
-
- All Implemented Interfaces:
IApplicableCandidate
,IFeatureLinkingCandidate
,ILinkingCandidate
public class NullFeatureLinkingCandidate extends AbstractNullLinkingCandidate implements IFeatureLinkingCandidate
-
-
Field Summary
-
Fields inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractNullLinkingCandidate
featureOrConstructorCall
-
-
Constructor Summary
Constructors Constructor Description NullFeatureLinkingCandidate(XAbstractFeatureCall featureCall, AbstractTypeComputationState 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.XAbstractFeatureCall
getFeatureCall()
Returns the feature call that is linked.ILinkingCandidate
getPreferredCandidate(ILinkingCandidate other)
Produces the best candidate for the current two candidates.boolean
isExtension()
Returnstrue
if the linked feature is contributed by an extension.boolean
isStatic()
Returnstrue
if the linked feature is static.boolean
isTypeLiteral()
Returnstrue
if the feature call is linked as a type literal.-
Methods inherited from class org.eclipse.xtext.xbase.typesystem.internal.AbstractNullLinkingCandidate
applyToModel, getExpression, getFeature, getTypeArguments, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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, getTypeArguments
-
-
-
-
Constructor Detail
-
NullFeatureLinkingCandidate
public NullFeatureLinkingCandidate(XAbstractFeatureCall featureCall, AbstractTypeComputationState state)
-
-
Method Detail
-
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
-
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
- Returns:
- whether the feature is static.
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidate
Returnstrue
if the linked feature is contributed by an extension.- Specified by:
isExtension
in interfaceIFeatureLinkingCandidate
- Returns:
- whether the feature is extension.
-
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
- Returns:
- whether the feature call is a type literal rather than a real feature call.
-
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
-
-