public abstract class AbstractLinkingCandidate<Expression extends XExpression> extends java.lang.Object implements ILinkingCandidate
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractLinkingCandidate.ArgumentTypeComputationState |
protected class |
AbstractLinkingCandidate.ObservableTypeExpectation |
| Modifier and Type | Field and Description |
|---|---|
protected IFeatureCallArguments |
arguments |
protected java.util.List<LightweightTypeReference> |
typeArguments |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLinkingCandidate(Expression expression,
ITypeExpectation expectation,
ExpressionTypeComputationState state) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
accept(AbstractLinkingCandidate.ObservableTypeExpectation expectation,
LightweightTypeReference actual) |
void |
applyToComputationState()
Apply this candidate to the current computation state model.
|
protected void |
computeArgumentType(IFeatureCallArgumentSlot slot) |
void |
computeArgumentTypes() |
protected void |
computeFixedArityArgumentType(IFeatureCallArgumentSlot slot,
TypeParameterSubstitutor<?> substitutor) |
protected void |
computeVarArgumentType(IFeatureCallArgumentSlot slot,
TypeParameterSubstitutor<?> substitutor) |
protected TypeParameterSubstitutor<?> |
createArgumentTypeSubstitutor() |
protected AbstractLinkingCandidate.ArgumentTypeComputationState |
createLinkingTypeComputationState(LightweightTypeReference expectedType) |
protected AbstractLinkingCandidate.ArgumentTypeComputationState |
createVarArgTypeComputationState(LightweightTypeReference componentType) |
protected LightweightTypeReference |
deferredBindTypeArgument(ITypeExpectation expectation,
LightweightTypeReference type) |
protected void |
discardRefinementTypeIfReassigned() |
protected LightweightTypeReference |
getActualType(org.eclipse.xtext.common.types.JvmIdentifiableElement element,
boolean ignoreReassignedTypes)
Returns the actual type of the given element.
|
protected LightweightTypeReference |
getActualType(XExpression expression) |
protected abstract java.util.List<XExpression> |
getArguments() |
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> |
getDeclaratorParameterMapping() |
protected LightweightTypeReference |
getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature) |
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> |
getDeclaredTypeParameters() |
protected LightweightTypeReference |
getExpectedType(XExpression expression) |
Expression |
getExpression()
The current expression that shall be linked.
|
abstract org.eclipse.xtext.common.types.JvmIdentifiableElement |
getFeature()
The currently considered feature (if any).
|
protected abstract java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> |
getPlainSyntacticTypeArguments() |
protected ExpressionTypeComputationState |
getState() |
protected LightweightTypeReference |
getSubstitutedExpectedType(int argumentIndex)
Returns the substituted expected type for the argument at
argumentIndex. |
protected java.util.List<LightweightTypeReference> |
getSyntacticTypeArguments() |
java.util.List<LightweightTypeReference> |
getTypeArguments()
The resolved type arguments.
|
protected abstract java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> |
getTypeParameterMapping() |
protected boolean |
hasReceiver()
Returns
true if the argument at index 0 will be considered as the receiver. |
protected void |
initializeArgumentTypeComputation() |
protected void |
initializeConstraintMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter,
UnboundTypeParameterPreservingSubstitutor substitutor,
UnboundTypeReference typeReference) |
protected void |
initializeMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter,
java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> result) |
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> |
initializeTypeParameterMapping() |
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> |
initializeTypeParameterMapping(java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> declaredTypeParameters) |
protected boolean |
isBoundTypeArgumentSkipped(org.eclipse.xtext.common.types.JvmTypeParameter type,
java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> mapping,
ITypeReferenceOwner owner) |
protected boolean |
isRawTypeContext() |
boolean |
isTypeLiteral() |
protected boolean |
mustDiscardRefinement() |
protected void |
preApply() |
protected void |
resolveAgainstActualType(LightweightTypeReference declaredType,
LightweightTypeReference actualType,
AbstractTypeComputationState state) |
protected void |
resolveArgumentType(XExpression argument,
LightweightTypeReference declaredType,
ITypeComputationState argumentState) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyToModel, getPreferredCandidatevalidateprotected java.util.List<LightweightTypeReference> typeArguments
protected IFeatureCallArguments arguments
protected AbstractLinkingCandidate(Expression expression, ITypeExpectation expectation, ExpressionTypeComputationState state)
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> initializeTypeParameterMapping()
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> initializeTypeParameterMapping(java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> declaredTypeParameters)
protected void initializeMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter,
java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> result)
protected void initializeConstraintMapping(org.eclipse.xtext.common.types.JvmTypeParameter typeParameter,
UnboundTypeParameterPreservingSubstitutor substitutor,
UnboundTypeReference typeReference)
protected void accept(AbstractLinkingCandidate.ObservableTypeExpectation expectation, LightweightTypeReference actual)
public java.util.List<LightweightTypeReference> getTypeArguments()
ILinkingCandidategetTypeArguments in interface ILinkingCandidateprotected abstract java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> getTypeParameterMapping()
protected java.util.List<org.eclipse.xtext.common.types.JvmTypeParameter> getDeclaredTypeParameters()
public void applyToComputationState()
ILinkingCandidateapplyToComputationState in interface ILinkingCandidateprotected void preApply()
protected LightweightTypeReference deferredBindTypeArgument(ITypeExpectation expectation, LightweightTypeReference type)
public void computeArgumentTypes()
protected void initializeArgumentTypeComputation()
protected void computeArgumentType(IFeatureCallArgumentSlot slot)
protected void computeVarArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
protected TypeParameterSubstitutor<?> createArgumentTypeSubstitutor()
protected boolean isBoundTypeArgumentSkipped(org.eclipse.xtext.common.types.JvmTypeParameter type,
java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> mapping,
ITypeReferenceOwner owner)
protected boolean isRawTypeContext()
protected void computeFixedArityArgumentType(IFeatureCallArgumentSlot slot, TypeParameterSubstitutor<?> substitutor)
protected AbstractLinkingCandidate.ArgumentTypeComputationState createLinkingTypeComputationState(LightweightTypeReference expectedType)
protected AbstractLinkingCandidate.ArgumentTypeComputationState createVarArgTypeComputationState(LightweightTypeReference componentType)
protected void resolveAgainstActualType(LightweightTypeReference declaredType, LightweightTypeReference actualType, AbstractTypeComputationState state)
protected LightweightTypeReference getDeclaredType(org.eclipse.xtext.common.types.JvmIdentifiableElement feature)
protected java.util.Map<org.eclipse.xtext.common.types.JvmTypeParameter,LightweightMergedBoundTypeArgument> getDeclaratorParameterMapping()
protected void resolveArgumentType(XExpression argument, LightweightTypeReference declaredType, ITypeComputationState argumentState)
argument - the expression that should be processed.declaredType - the declared (expected) type for the given expression.argumentState - the to-be-used state to compute the actual type of the argument. It is already configured with the expectation.protected abstract java.util.List<XExpression> getArguments()
protected LightweightTypeReference getExpectedType(XExpression expression)
protected LightweightTypeReference getActualType(org.eclipse.xtext.common.types.JvmIdentifiableElement element, boolean ignoreReassignedTypes)
protected LightweightTypeReference getActualType(XExpression expression)
protected LightweightTypeReference getSubstitutedExpectedType(int argumentIndex)
argumentIndex.
If the expected type is an unbound type parameter, a reference to the type parameter
itself is returned.protected java.util.List<LightweightTypeReference> getSyntacticTypeArguments()
protected abstract java.util.List<org.eclipse.xtext.common.types.JvmTypeReference> getPlainSyntacticTypeArguments()
public abstract org.eclipse.xtext.common.types.JvmIdentifiableElement getFeature()
ILinkingCandidatenull.getFeature in interface ILinkingCandidatepublic Expression getExpression()
ILinkingCandidategetExpression in interface ILinkingCandidateprotected boolean hasReceiver()
true if the argument at index 0 will be considered as the receiver.public boolean isTypeLiteral()
protected ExpressionTypeComputationState getState()
protected boolean mustDiscardRefinement()
protected void discardRefinementTypeIfReassigned()