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 protected
AbstractAmbiguousLinkingCandidate(Candidate first, AbstractPendingLinkingCandidate<?> second)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addCandidate(AbstractPendingLinkingCandidate<?> next)
void
applyToComputationState()
Apply this candidate to the current computation state model.void
applyToModel(IResolvedTypes resolvedTypes)
Injects the resolved feature into the model with the same semantics as the implicitresolve
of EMF.protected CandidateCompareResult
compareTo(AbstractPendingLinkingCandidate<?> right)
java.util.List<? extends ILinkingCandidate>
getAlternatives()
A readonly representation of all equally good candidates.protected java.lang.String
getDeclaratorSimpleName(org.eclipse.xtext.common.types.JvmIdentifiableElement element)
protected abstract java.lang.String[]
getDiagnosticData()
XExpression
getExpression()
The current expression that shall be linked.org.eclipse.xtext.common.types.JvmIdentifiableElement
getFeature()
The currently considered feature (if any).protected abstract org.eclipse.emf.ecore.EStructuralFeature
getFeatureToMark()
protected java.lang.String
getFeatureTypeName()
ILinkingCandidate
getPreferredCandidate(ILinkingCandidate other)
Produces the best candidate for the current two candidates.protected Candidate
getPrimaryCandidate()
protected abstract java.lang.String
getSyntaxDescriptions()
java.util.List<LightweightTypeReference>
getTypeArguments()
The resolved type arguments.boolean
validate(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:IAmbiguousLinkingCandidate
A readonly representation of all equally good candidates. The list is never null or empty.- Specified by:
getAlternatives
in interfaceIAmbiguousLinkingCandidate
- Returns:
- all the candidates.
-
addCandidate
protected final void addCandidate(AbstractPendingLinkingCandidate<?> next)
-
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
-
compareTo
protected CandidateCompareResult compareTo(AbstractPendingLinkingCandidate<?> right)
-
getPrimaryCandidate
protected final Candidate getPrimaryCandidate()
-
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
-
applyToModel
public void applyToModel(IResolvedTypes resolvedTypes)
Description copied from interface:ILinkingCandidate
Injects the resolved feature into the model with the same semantics as the implicitresolve
of EMF. This implies that the linked feature call may still point to a proxy afterwards.- Specified by:
applyToModel
in interfaceIApplicableCandidate
- Specified by:
applyToModel
in interfaceILinkingCandidate
-
validate
public boolean validate(org.eclipse.xtext.util.IAcceptor<? super org.eclipse.xtext.diagnostics.AbstractDiagnostic> result)
Description copied from interface:IApplicableCandidate
Produce diagnostics for this condidate. It is not the responsibility of this candidate to propagate the acceptor to its children.- Specified by:
validate
in interfaceIApplicableCandidate
- Returns:
true
if 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:ILinkingCandidate
The currently considered feature (if any). Otherwisenull
.- Specified by:
getFeature
in interfaceILinkingCandidate
-
getExpression
public XExpression getExpression()
Description copied from interface:ILinkingCandidate
The current expression that shall be linked.- Specified by:
getExpression
in interfaceILinkingCandidate
-
getTypeArguments
public java.util.List<LightweightTypeReference> getTypeArguments()
Description copied from interface:ILinkingCandidate
The resolved type arguments.- Specified by:
getTypeArguments
in interfaceILinkingCandidate
-
-