org.eclipse.xtext.xbase.typing
Interface ITypeProvider

All Known Implementing Classes:
AbstractTypeProvider, XbaseTypeProvider, XbaseWithAnnotationsTypeProvider, Xtend2TypeProvider

public interface ITypeProvider

Author:
Sven Efftinge - Initial contribution and API

Method Summary
 JvmTypeReference getCommonReturnType(XExpression expression, boolean assumeImplicitReturn)
          The return type of an expression is the common super type of all types used within a return expression.
 JvmTypeReference getExpectedType(XExpression expression)
          Return the resolved expected type of the given expression.
 JvmTypeReference getExpectedType(XExpression expression, boolean rawType)
           
 java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
          returns the exception types, declared to be thrown by referencing / executing the passed JvmIdentifiableElement.
 java.lang.Iterable<JvmTypeReference> getThrownExceptionTypes(XExpression expression)
          returns all exception types, thrown within the given expression.
 JvmTypeReference getType(XExpression expression)
          Return the resolved type of the given expression.
 JvmTypeReference getType(XExpression expression, boolean rawType)
           
 JvmTypeReference getTypeForIdentifiable(JvmIdentifiableElement identifiableElement)
          Return the resolved type of the element.
 JvmTypeReference getTypeForIdentifiable(JvmIdentifiableElement identifiableElement, boolean rawType)
           
 

Method Detail

getExpectedType

JvmTypeReference getExpectedType(XExpression expression)
Return the resolved expected type of the given expression. Same as getExpectedType(expression, false.

Parameters:
expression - the expression. May not be null.
Returns:
the fully-resolved expected type of the given expression, if a correct, fully-linkable model is given. Returns null if no special type is expected

getExpectedType

JvmTypeReference getExpectedType(XExpression expression,
                                 boolean rawType)
Parameters:
expression - the expression. May not be null.
rawType - true if the raw type is sufficient.
Returns:
the fully-resolved expected type of the given expression, if a correct, fully-linkable model is given. Returns null if no special type is expected

getType

JvmTypeReference getType(XExpression expression)
Return the resolved type of the given expression. Same as getType(expression, false.

Parameters:
expression - the expression. May not be null.
Returns:
the fully-resolved type of the XExpression, if a correct, fully-linkable model is given. null indicates a problem during resolution.

getType

JvmTypeReference getType(XExpression expression,
                         boolean rawType)
Parameters:
expression - the expression. May not be null.
rawType - true if the raw type is sufficient.
Returns:
the fully-resolved type of the XExpression, if a correct, fully-linkable model is given. null indicates a problem during resolution.

getTypeForIdentifiable

JvmTypeReference getTypeForIdentifiable(JvmIdentifiableElement identifiableElement)
Return the resolved type of the element. Same as getTypeForIdentifiable(identifiableElement, false.

Parameters:
identifiableElement - the identifiable element. May not be null.
Returns:
the fully-resolved type of the JvmIdentifiableElement, if a correct, fully-linkable model is given. null indicates a problem during resolution. given.

getTypeForIdentifiable

JvmTypeReference getTypeForIdentifiable(JvmIdentifiableElement identifiableElement,
                                        boolean rawType)
Parameters:
identifiableElement - the identifiable element. May not be null.
rawType - true if the raw type is sufficient.
Returns:
the fully-resolved type of the JvmIdentifiableElement, if a correct, fully-linkable model is given. null indicates a problem during resolution. given.

getCommonReturnType

JvmTypeReference getCommonReturnType(XExpression expression,
                                     boolean assumeImplicitReturn)
The return type of an expression is the common super type of all types used within a return expression.

Parameters:
expression - May not be null.
assumeImplicitReturn - indicating whether an implicit return expression should be assumed
Returns:
the fully-resolved common return type of the XExpression, if a correct, fully-linkable model is given. null indicates a problem during computation, the primitive void indicates that no return expression was found.

getThrownExceptionTypes

java.lang.Iterable<JvmTypeReference> getThrownExceptionTypes(XExpression expression)
returns all exception types, thrown within the given expression. This includes explicitly declared RuntimeExceptions as well.

Parameters:
expression - May not be null.
Returns:
the iterable of fully-resolved exception types, if a correct, fully-linkable model is given. null indicates a problem during computation, an empty iterable means no thrown exceptions were found.

getThrownExceptionForIdentifiable

java.lang.Iterable<JvmTypeReference> getThrownExceptionForIdentifiable(JvmIdentifiableElement identifiable)
returns the exception types, declared to be thrown by referencing / executing the passed JvmIdentifiableElement. This includes explicitly declared RuntimeExceptions as well.

Parameters:
identifiable - May not be null.
Returns:
the iterable of fully-resolved exception types, if a correct, fully-linkable model is given. null indicates a problem during computation, an empty iterable means no thrown exceptions were found.