org.eclipse.xtext.xbase.typing
Class FunctionConversion

java.lang.Object
  extended by org.eclipse.xtext.xbase.typing.FunctionConversion

public class FunctionConversion
extends java.lang.Object

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
FunctionConversion()
           
 
Method Summary
 JvmParameterizedTypeReference createFunctionTypeRef(org.eclipse.emf.ecore.EObject context, java.util.List<JvmTypeReference> parameterTypes, JvmTypeReference returnType)
           
 JvmParameterizedTypeReference createRawFunctionTypeRef(org.eclipse.emf.ecore.EObject context, int parameterCount)
           
 JvmTypeReference findMatch(JvmTypeParameter jvmTypeParameter, JvmTypeReference declaration, JvmTypeReference information)
          finds the JvmTypeReference in information according to the position declaration refers to JvmTypeParameter.
 JvmOperation findSingleMethod(JvmTypeReference type)
           
 JvmTypeReference getResolvedExpectedType(JvmTypeReference expectedType, JvmTypeReference actualType)
          parameterizes the expected type with the type arguments from the actualType
 JvmTypeReference getReturnType(JvmTypeReference functionType)
           
protected  boolean isConformant(org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc left, TypeArgumentContext leftCtx, org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc right, TypeArgumentContext rightCtx)
           
 boolean isConformant(JvmTypeReference left, JvmTypeReference right, boolean ignoreGenerics)
           
 boolean isFunction(JvmTypeReference type)
           
protected  boolean isValidFunction(JvmOperation op)
           
protected  java.lang.Class<?> loadFunctionClass(java.lang.String simpleFunctionName)
           
protected  org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc toFuncDesc(JvmTypeReference typeReference)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionConversion

public FunctionConversion()
Method Detail

isConformant

public boolean isConformant(JvmTypeReference left,
                            JvmTypeReference right,
                            boolean ignoreGenerics)

toFuncDesc

protected org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc toFuncDesc(JvmTypeReference typeReference)

isConformant

protected boolean isConformant(org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc left,
                               TypeArgumentContext leftCtx,
                               org.eclipse.xtext.xbase.typing.FunctionConversion.FuncDesc right,
                               TypeArgumentContext rightCtx)

findSingleMethod

public JvmOperation findSingleMethod(JvmTypeReference type)

isValidFunction

protected boolean isValidFunction(JvmOperation op)

isFunction

public boolean isFunction(JvmTypeReference type)

getResolvedExpectedType

public JvmTypeReference getResolvedExpectedType(JvmTypeReference expectedType,
                                                JvmTypeReference actualType)
parameterizes the expected type with the type arguments from the actualType


getReturnType

public JvmTypeReference getReturnType(JvmTypeReference functionType)

findMatch

public JvmTypeReference findMatch(JvmTypeParameter jvmTypeParameter,
                                  JvmTypeReference declaration,
                                  JvmTypeReference information)
finds the JvmTypeReference in information according to the position declaration refers to JvmTypeParameter. For Example: given a method List foo(); where is the passed JvmTypeParameter and 'List' is the passed declaration JvmTypeReference, if another List is passed as information, the method returns a JvmTypeReference pointing to 'String'.


createRawFunctionTypeRef

public JvmParameterizedTypeReference createRawFunctionTypeRef(org.eclipse.emf.ecore.EObject context,
                                                              int parameterCount)

createFunctionTypeRef

public JvmParameterizedTypeReference createFunctionTypeRef(org.eclipse.emf.ecore.EObject context,
                                                           java.util.List<JvmTypeReference> parameterTypes,
                                                           JvmTypeReference returnType)

loadFunctionClass

protected java.lang.Class<?> loadFunctionClass(java.lang.String simpleFunctionName)