@NonNullByDefault public abstract class AbstractAmbiguousLinkingCandidate<Candidate extends AbstractPendingLinkingCandidate<?>> extends java.lang.Object implements ILinkingCandidate, IAmbiguousLinkingCandidate
Modifier | Constructor and Description |
---|---|
protected |
AbstractAmbiguousLinkingCandidate(Candidate first,
AbstractPendingLinkingCandidate<?> second) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCandidate(AbstractPendingLinkingCandidate<?> next) |
void |
applyToComputationState()
Apply this candidate to the current computation state model.
|
void |
applyToModel()
Injects the resolved feature into the model with the same semantics as the implicit
resolve
of EMF. |
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult |
compareTo(AbstractPendingLinkingCandidate<?> right) |
java.util.List<? extends ILinkingCandidate> |
getAlternatives()
A readonly representation of all equally good candidates.
|
protected java.lang.String |
getDeclaratorSimpleName(JvmIdentifiableElement element) |
protected abstract java.lang.String[] |
getDiagnosticData() |
XExpression |
getExpression()
The current expression that shall be linked.
|
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(IAcceptor<? super AbstractDiagnostic> result)
Produce diagnostics for this condidate.
|
protected AbstractAmbiguousLinkingCandidate(Candidate first, AbstractPendingLinkingCandidate<?> second)
public java.util.List<? extends ILinkingCandidate> getAlternatives()
IAmbiguousLinkingCandidate
getAlternatives
in interface IAmbiguousLinkingCandidate
protected final void addCandidate(AbstractPendingLinkingCandidate<?> next)
public ILinkingCandidate getPreferredCandidate(ILinkingCandidate other)
ILinkingCandidate
this
and other
) 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 on ILinkingCandidate.applyToComputationState()
,
ILinkingCandidate.applyToModel()
, and ILinkingCandidate.validate(IAcceptor)
.getPreferredCandidate
in interface ILinkingCandidate
protected org.eclipse.xtext.xbase.typesystem.internal.CandidateCompareResult compareTo(AbstractPendingLinkingCandidate<?> right)
protected final Candidate getPrimaryCandidate()
public void applyToComputationState()
ILinkingCandidate
applyToComputationState
in interface ILinkingCandidate
public void applyToModel()
ILinkingCandidate
resolve
of EMF. This implies that the linked feature call may still point to a proxy afterwards.applyToModel
in interface ILinkingCandidate
public boolean validate(IAcceptor<? super AbstractDiagnostic> result)
ILinkingCandidate
validate
in interface ILinkingCandidate
true
if further validation should be performed.protected abstract java.lang.String[] getDiagnosticData()
protected java.lang.String getFeatureTypeName()
protected abstract java.lang.String getSyntaxDescriptions()
@Nullable protected java.lang.String getDeclaratorSimpleName(JvmIdentifiableElement element)
protected abstract org.eclipse.emf.ecore.EStructuralFeature getFeatureToMark()
@Nullable public JvmIdentifiableElement getFeature()
ILinkingCandidate
null
.getFeature
in interface ILinkingCandidate
public XExpression getExpression()
ILinkingCandidate
getExpression
in interface ILinkingCandidate
public java.util.List<LightweightTypeReference> getTypeArguments()
ILinkingCandidate
getTypeArguments
in interface ILinkingCandidate