Class AbstractAmbiguousLinkingCandidate<Candidate extends AbstractPendingLinkingCandidate<?>>
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.internal.AbstractAmbiguousLinkingCandidate<Candidate>
-
- All Implemented Interfaces:
IAmbiguousLinkingCandidate,IApplicableCandidate,ILinkingCandidate
- Direct Known Subclasses:
AmbiguousConstructorLinkingCandidate,AmbiguousFeatureLinkingCandidate
public abstract class AbstractAmbiguousLinkingCandidate<Candidate extends AbstractPendingLinkingCandidate<?>> extends java.lang.Object implements ILinkingCandidate, IAmbiguousLinkingCandidate
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAmbiguousLinkingCandidate(Candidate first, AbstractPendingLinkingCandidate<?> second)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddCandidate(AbstractPendingLinkingCandidate<?> next)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)java.util.List<? extends ILinkingCandidate>getAlternatives()A readonly representation of all equally good candidates.protected java.lang.StringgetDeclaratorSimpleName(org.eclipse.xtext.common.types.JvmIdentifiableElement element)protected abstract java.lang.String[]getDiagnosticData()XExpressiongetExpression()The current expression that shall be linked.org.eclipse.xtext.common.types.JvmIdentifiableElementgetFeature()The currently considered feature (if any).protected abstract org.eclipse.emf.ecore.EStructuralFeaturegetFeatureToMark()protected java.lang.StringgetFeatureTypeName()ILinkingCandidategetPreferredCandidate(ILinkingCandidate other)Produces the best candidate for the current two candidates.protected CandidategetPrimaryCandidate()protected abstract java.lang.StringgetSyntaxDescriptions()java.util.List<LightweightTypeReference>getTypeArguments()The resolved type arguments.booleanvalidate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)Produce diagnostics for this condidate.
-
-
-
Constructor Detail
-
AbstractAmbiguousLinkingCandidate
protected AbstractAmbiguousLinkingCandidate(Candidate first, AbstractPendingLinkingCandidate<?> second)
-
-
Method Detail
-
getAlternatives
public java.util.List<? extends ILinkingCandidate> getAlternatives()
Description copied from interface:IAmbiguousLinkingCandidateA readonly representation of all equally good candidates. The list is never null or empty.- Specified by:
getAlternativesin interfaceIAmbiguousLinkingCandidate- Returns:
- all the candidates.
-
addCandidate
protected final void addCandidate(AbstractPendingLinkingCandidate<?> next)
-
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)
-
getPrimaryCandidate
protected final Candidate getPrimaryCandidate()
-
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.
-
getDiagnosticData
protected abstract java.lang.String[] getDiagnosticData()
-
getFeatureTypeName
protected java.lang.String getFeatureTypeName()
-
getSyntaxDescriptions
protected abstract java.lang.String getSyntaxDescriptions()
-
getDeclaratorSimpleName
protected java.lang.String getDeclaratorSimpleName(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
-
getFeatureToMark
protected abstract org.eclipse.emf.ecore.EStructuralFeature getFeatureToMark()
-
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
-
-