org.eclipse.xtext.common.types.util
Class TypeArgumentContextProvider
java.lang.Object
org.eclipse.xtext.common.types.util.TypeArgumentContextProvider
- Direct Known Subclasses:
- XtendTypeArgumentContextProvider
public class TypeArgumentContextProvider
- extends java.lang.Object
Method Summary |
protected JvmTypeReference |
computeVarArgTypeInformation(JvmFeature feature,
JvmType type)
|
protected boolean |
containsEntry(com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
JvmTypeParameter typeParameter,
TypeArgumentContextProvider.ResolveInfo information)
|
TypeArgumentContext |
get(java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context)
|
protected TypeArgumentContextProvider.ResolveInfo |
getBetterMatch(TypeArgumentContextProvider.ResolveInfo current,
TypeArgumentContextProvider.ResolveInfo isBetter)
|
TypeArgumentContext |
getExplicitMethodInvocationContext(JvmTypeParameterDeclarator parameterDeclarator,
JvmTypeReference receiverType,
java.util.List<JvmTypeReference> typeArguments)
Creates a type argument context explicitly declared type arguments. |
TypeArgumentContext |
getInferredMethodInvocationContext(JvmOperation op,
JvmTypeReference receiverType,
JvmTypeReference expectedReturnType,
JvmTypeReference... actualArgumentTypes)
|
TypeArgumentContext |
getNullContext()
|
TypeArgumentContext |
getReceiverContext(JvmTypeReference receiver)
|
TypeArgumentContext |
getReceiverContext(JvmTypeReference receiverType,
JvmTypeReference featureType,
JvmTypeReference expectedType)
|
protected JvmTypeParameter |
getReferenceTypeParameter(JvmTypeReference ref)
|
TypeArgumentContext |
injectArgumentTypeContext(TypeArgumentContext context,
JvmConstructor operation,
JvmTypeReference createdResult,
boolean ignoreEmptyVarArgs,
JvmTypeReference... actualArgumentTypes)
|
TypeArgumentContext |
injectArgumentTypeContext(TypeArgumentContext context,
JvmOperation operation,
boolean ignoreEmptyVarArgs,
JvmTypeReference... actualArgumentTypes)
|
TypeArgumentContext |
injectExpectedTypeContext(TypeArgumentContext context,
JvmConstructor constructor,
JvmTypeReference createdResult,
JvmTypeReference expectedType)
|
TypeArgumentContext |
injectExpectedTypeContext(TypeArgumentContext context,
JvmOperation operation,
JvmTypeReference expectedType)
|
TypeArgumentContext |
injectReceiverContext(TypeArgumentContext context,
JvmTypeReference receiverType)
|
protected void |
internalComputeContext(JvmTypeReference contextRef,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context,
java.util.Set<JvmType> computing)
|
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
internalFindBestMatches(com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> map)
|
protected boolean |
isResolved(JvmTypeReference type)
|
protected void |
resolve(JvmTypeParameter key,
TypeArgumentContextProvider.ResolveInfo info,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
boolean ignoreOperationArguments)
|
protected void |
resolve(JvmTypeReference declaration,
TypeArgumentContextProvider.ResolveInfo information,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
boolean returnTypeContext)
|
java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
resolveInferredMethodTypeArgContext(JvmFeature feature,
JvmTypeReference returnType,
JvmTypeReference expectation,
boolean ignoreEmptyVarArgs,
JvmTypeReference... argumentTypes)
|
java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
resolveInferredMethodTypeArgContext(JvmFeature feature,
JvmTypeReference returnType,
JvmTypeReference expectation,
JvmTypeReference... argumentTypes)
|
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
resolveInferredTypeArgContext(JvmTypeReference featureType,
JvmTypeReference expectation,
boolean ignoreOperationTypeParameters)
|
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
resolveReceiver(JvmTypeReference contextRef)
|
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> |
resolveTypeParametersReferencedInTypeParameters(java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context,
boolean ignoreOperationArguments)
|
void |
setConformanceComputer(TypeConformanceComputer conformanceComputer)
|
void |
setTypeProviderFactory(IJvmTypeProvider.Factory typeProviderFactory)
|
void |
setTypeReferences(TypeReferences typeReferences)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeArgumentContextProvider
public TypeArgumentContextProvider()
setTypeProviderFactory
public void setTypeProviderFactory(IJvmTypeProvider.Factory typeProviderFactory)
setTypeReferences
public void setTypeReferences(TypeReferences typeReferences)
setConformanceComputer
public void setConformanceComputer(TypeConformanceComputer conformanceComputer)
getNullContext
public final TypeArgumentContext getNullContext()
get
public TypeArgumentContext get(java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context)
getReceiverContext
public TypeArgumentContext getReceiverContext(JvmTypeReference receiver)
getReceiverContext
public TypeArgumentContext getReceiverContext(JvmTypeReference receiverType,
JvmTypeReference featureType,
JvmTypeReference expectedType)
resolveInferredTypeArgContext
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> resolveInferredTypeArgContext(JvmTypeReference featureType,
JvmTypeReference expectation,
boolean ignoreOperationTypeParameters)
getExplicitMethodInvocationContext
public TypeArgumentContext getExplicitMethodInvocationContext(JvmTypeParameterDeclarator parameterDeclarator,
JvmTypeReference receiverType,
java.util.List<JvmTypeReference> typeArguments)
Creates a type argument context explicitly declared type arguments.
- Parameters:
parameterDeclarator
- the declarator whose parameters should be matched with the argumentsreceiverType
- the resolved type of the message receivertypeArguments
- the explicit type arguments of the sent message
- Returns:
- the type argument context. Is never
null
.
injectReceiverContext
public TypeArgumentContext injectReceiverContext(TypeArgumentContext context,
JvmTypeReference receiverType)
injectArgumentTypeContext
public TypeArgumentContext injectArgumentTypeContext(TypeArgumentContext context,
JvmOperation operation,
boolean ignoreEmptyVarArgs,
JvmTypeReference... actualArgumentTypes)
injectArgumentTypeContext
public TypeArgumentContext injectArgumentTypeContext(TypeArgumentContext context,
JvmConstructor operation,
JvmTypeReference createdResult,
boolean ignoreEmptyVarArgs,
JvmTypeReference... actualArgumentTypes)
injectExpectedTypeContext
public TypeArgumentContext injectExpectedTypeContext(TypeArgumentContext context,
JvmOperation operation,
JvmTypeReference expectedType)
injectExpectedTypeContext
public TypeArgumentContext injectExpectedTypeContext(TypeArgumentContext context,
JvmConstructor constructor,
JvmTypeReference createdResult,
JvmTypeReference expectedType)
getInferredMethodInvocationContext
public TypeArgumentContext getInferredMethodInvocationContext(JvmOperation op,
JvmTypeReference receiverType,
JvmTypeReference expectedReturnType,
JvmTypeReference... actualArgumentTypes)
resolveTypeParametersReferencedInTypeParameters
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> resolveTypeParametersReferencedInTypeParameters(java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context,
boolean ignoreOperationArguments)
resolveReceiver
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> resolveReceiver(JvmTypeReference contextRef)
resolveInferredMethodTypeArgContext
public java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> resolveInferredMethodTypeArgContext(JvmFeature feature,
JvmTypeReference returnType,
JvmTypeReference expectation,
JvmTypeReference... argumentTypes)
resolveInferredMethodTypeArgContext
public java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> resolveInferredMethodTypeArgContext(JvmFeature feature,
JvmTypeReference returnType,
JvmTypeReference expectation,
boolean ignoreEmptyVarArgs,
JvmTypeReference... argumentTypes)
computeVarArgTypeInformation
protected JvmTypeReference computeVarArgTypeInformation(JvmFeature feature,
JvmType type)
internalFindBestMatches
protected java.util.Map<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> internalFindBestMatches(com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> map)
getBetterMatch
protected TypeArgumentContextProvider.ResolveInfo getBetterMatch(TypeArgumentContextProvider.ResolveInfo current,
TypeArgumentContextProvider.ResolveInfo isBetter)
isResolved
protected boolean isResolved(JvmTypeReference type)
internalComputeContext
protected void internalComputeContext(JvmTypeReference contextRef,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> context,
java.util.Set<JvmType> computing)
resolve
protected void resolve(JvmTypeReference declaration,
TypeArgumentContextProvider.ResolveInfo information,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
boolean returnTypeContext)
containsEntry
protected boolean containsEntry(com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
JvmTypeParameter typeParameter,
TypeArgumentContextProvider.ResolveInfo information)
getReferenceTypeParameter
protected JvmTypeParameter getReferenceTypeParameter(JvmTypeReference ref)
resolve
protected void resolve(JvmTypeParameter key,
TypeArgumentContextProvider.ResolveInfo info,
com.google.common.collect.Multimap<JvmTypeParameter,TypeArgumentContextProvider.ResolveInfo> existing,
boolean ignoreOperationArguments)