Class SuspiciouslyOverloadedCandidate
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.SuspiciouslyOverloadedCandidate
-
- All Implemented Interfaces:
IApplicableCandidate,IFeatureLinkingCandidate,ILinkingCandidate,ISuspiciouslyOverloadedCandidate
public class SuspiciouslyOverloadedCandidate extends java.lang.Object implements IFeatureLinkingCandidate, ISuspiciouslyOverloadedCandidate
A linking candidate that was picked from an implicitthisreceiver though an overloaded candidate onitexists.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSuspiciouslyOverloadedCandidate(FeatureLinkingCandidate chosenCandidate, FeatureLinkingCandidate rejectedCandidate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCandidate(FeatureLinkingCandidate candidate, java.lang.StringBuilder result)voidapplyToComputationState()Apply this candidate to the current computation state model.voidapplyToModel(IResolvedTypes resolvedTypes)Injects the resolved feature into the model with the same semantics as the implicitresolveof EMF.protected CandidateCompareResultcompareTo(AbstractPendingLinkingCandidate<?> right)FeatureLinkingCandidategetChosenCandidate()protected java.lang.StringgetDeclaratorSimpleName(org.eclipse.xtext.common.types.JvmIdentifiableElement element)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 java.lang.StringgetFeatureTypeName()ILinkingCandidategetPreferredCandidate(ILinkingCandidate other)Produces the best candidate for the current two candidates.FeatureLinkingCandidategetRejectedCandidate()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.
-
-
-
Constructor Detail
-
SuspiciouslyOverloadedCandidate
protected SuspiciouslyOverloadedCandidate(FeatureLinkingCandidate chosenCandidate, FeatureLinkingCandidate rejectedCandidate)
-
-
Method Detail
-
getChosenCandidate
public FeatureLinkingCandidate getChosenCandidate()
- Specified by:
getChosenCandidatein interfaceISuspiciouslyOverloadedCandidate- Returns:
- the applied candidate.
-
getRejectedCandidate
public FeatureLinkingCandidate getRejectedCandidate()
- Specified by:
getRejectedCandidatein interfaceISuspiciouslyOverloadedCandidate- Returns:
- the suspiciously rejected candidate.
-
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
-
compareTo
protected CandidateCompareResult compareTo(AbstractPendingLinkingCandidate<?> right)
-
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
-
applyToModel
public void applyToModel(IResolvedTypes resolvedTypes)
Description copied from interface:ILinkingCandidateInjects the resolved feature into the model with the same semantics as the implicitresolveof EMF. This implies that the linked feature call may still point to a proxy afterwards.- Specified by:
applyToModelin interfaceIApplicableCandidate- Specified by:
applyToModelin 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.
-
appendCandidate
protected void appendCandidate(FeatureLinkingCandidate candidate, java.lang.StringBuilder result)
-
getFeatureTypeName
protected java.lang.String getFeatureTypeName()
-
getDeclaratorSimpleName
protected java.lang.String getDeclaratorSimpleName(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
-
getFeature
public org.eclipse.xtext.common.types.JvmIdentifiableElement getFeature()
Description copied from interface:ILinkingCandidateThe currently considered feature (if any). Otherwisenull.- Specified by:
getFeaturein interfaceILinkingCandidate
-
getExpression
public XExpression getExpression()
Description copied from interface:ILinkingCandidateThe current expression that shall be linked.- Specified by:
getExpressionin interfaceILinkingCandidate
-
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.
-
isStatic
public boolean isStatic()
Description copied from interface:IFeatureLinkingCandidateReturnstrueif the linked feature is static.- Specified by:
isStaticin interfaceIFeatureLinkingCandidate- Returns:
- whether the feature is static.
-
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.
-
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.
-
-