Class AbstractImplicitFeature
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractImplicitFeature
-
- All Implemented Interfaces:
IApplicableCandidate,IFeatureLinkingCandidate,ILinkingCandidate
- Direct Known Subclasses:
ImplicitFirstArgument,ImplicitReceiver
public abstract class AbstractImplicitFeature extends java.lang.Object implements IFeatureLinkingCandidate
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractImplicitFeature(XAbstractFeatureCall featureCall, XAbstractFeatureCall implicit, 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.XExpressiongetExpression()The current expression that shall be linked.org.eclipse.xtext.common.types.JvmIdentifiableElementgetFeature()The currently considered feature (if any).XAbstractFeatureCallgetFeatureCall()Returns the feature call that is linked.protected XAbstractFeatureCallgetOwner()ILinkingCandidategetPreferredCandidate(ILinkingCandidate other)Produces the best candidate for the current two candidates.protected ExpressionTypeComputationStategetState()java.util.List<LightweightTypeReference>getTypeArguments()The resolved type arguments.booleanisExtension()Returnstrueif the linked feature is contributed by an extension.booleanisStatic()Returnstrueif the linked feature is static.booleanisTypeLiteral()Returnstrueif the feature call is linked as a type literal.booleanvalidate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)Produce diagnostics for this condidate.-
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.ILinkingCandidate
applyToModel
-
-
-
-
Constructor Detail
-
AbstractImplicitFeature
protected AbstractImplicitFeature(XAbstractFeatureCall featureCall, XAbstractFeatureCall implicit, ExpressionTypeComputationState state)
-
-
Method Detail
-
getState
protected ExpressionTypeComputationState getState()
-
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
-
getOwner
protected XAbstractFeatureCall getOwner()
-
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
-
getFeature
public org.eclipse.xtext.common.types.JvmIdentifiableElement getFeature()
Description copied from interface:ILinkingCandidateThe currently considered feature (if any). Otherwisenull.- Specified by:
getFeaturein interfaceILinkingCandidate
-
validate
public boolean validate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
Description copied from interface:IApplicableCandidateProduce diagnostics for this condidate. It is not the responsibility of this candidate to propagate the acceptor to its children.- Specified by:
validatein interfaceIApplicableCandidate- Returns:
trueif further validation should be performed.
-
getTypeArguments
public java.util.List<LightweightTypeReference> getTypeArguments()
Description copied from interface:ILinkingCandidateThe resolved type arguments.- Specified by:
getTypeArgumentsin interfaceILinkingCandidate
-
getFeatureCall
public XAbstractFeatureCall getFeatureCall()
Description copied from interface:IFeatureLinkingCandidateReturns the feature call that is linked.- Specified by:
getFeatureCallin interfaceIFeatureLinkingCandidate- Returns:
- the feature call.
-
getExpression
public XExpression getExpression()
Description copied from interface:ILinkingCandidateThe current expression that shall be linked.- Specified by:
getExpressionin interfaceILinkingCandidate
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is static.- Specified by:
isStaticin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature is static.
-
isTypeLiteral
public boolean isTypeLiteral()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the feature call is linked as a type literal.- Specified by:
isTypeLiteralin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature call is a type literal rather than a real feature call.
-
isExtension
public boolean isExtension()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is contributed by an extension.- Specified by:
isExtensionin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature is extension.
-
-