Class AbstractExecutableType
java.lang.Object
org.checkerframework.framework.util.typeinference8.types.AbstractExecutableType
- Direct Known Subclasses:
AbstractInvocationType,CompileTimeDeclarationType
An inference type for a method call, a constructor invocation, or a compile-time declaration of a
method reference. This is a wrapper around
AnnotatedTypeMirror.AnnotatedExecutableType whose methods return
AbstractType.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotatedTypeMirror.AnnotatedExecutableTypeThe underlying annotated method or constructor type.protected final Java8InferenceContextThe inference context.protected final ExecutableTypeThe underlying Java method or constructor type.protected final AnnotationMirrorMap<QualifierVar> A mapping from polymorphic annotation toQualifierVar.protected final AnnotatedTypeFactoryThe annotated type factory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractExecutableType(AnnotatedTypeMirror.AnnotatedExecutableType annotatedExecutableType, ExecutableType executableType, ExpressionTree invocation, Java8InferenceContext context) Fills in fields of abstract class AbstractExecutableType. -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying annotated method or constructor type.List<? extends AnnotatedTypeMirror.AnnotatedTypeVariable> Returns the annotated type variables.Returns the Java method or constructor type.getParameterTypes(Theta map) Returns the parameter types of this.abstract List<AbstractType> getParameterTypes(Theta map, int size) Returns a list of the parameter types ofAbstractExecutableTypewhere the vararg parameter has been replaced by individual parameters so the result has lengthsize.protected final List<AbstractType> getParameterTypes(Theta map, int size, AnnotatedTypeMirror firstParam, boolean isVarargsCall) Returns a list of the parameter types ofInferenceExecutableTypewhere the vararg parameter has been replaced by individual parameters so the result has lengthsize.abstract AbstractTypegetReturnType(Theta map) Returns the return type of this.List<? extends AbstractType> getThrownTypes(Theta map) Returns the thrown types of this.List<? extends TypeVariable> Returns the Java type variables.booleanReturns true if this type has type variables.booleanisVoid()Returns true if this method or constructor has void return type.
-
Field Details
-
annotatedExecutableType
The underlying annotated method or constructor type. -
executableType
The underlying Java method or constructor type. -
context
The inference context. -
typeFactory
The annotated type factory. -
qualifierVars
A mapping from polymorphic annotation toQualifierVar. It keeps track of which annotation mirror is be represented by whichQualifierVar.
-
-
Constructor Details
-
AbstractExecutableType
protected AbstractExecutableType(AnnotatedTypeMirror.AnnotatedExecutableType annotatedExecutableType, ExecutableType executableType, ExpressionTree invocation, Java8InferenceContext context) Fills in fields of abstract class AbstractExecutableType.- Parameters:
annotatedExecutableType- the underlying annotated method or constructor typeexecutableType- the underlying Java method or constructor type. This must be an argument to the constructor, because it is not always equal toannotatedExecutableType.getUnderlyingType().invocation- a method or constructor invocationcontext- the context
-
-
Method Details
-
getJavaType
Returns the Java method or constructor type.- Returns:
- the Java method or constructor type
-
getThrownTypes
Returns the thrown types of this.- Parameters:
map- a mapping from type variable to inference variable- Returns:
- the thrown types
-
getReturnType
Returns the return type of this.- Parameters:
map- a mapping from type variable to inference variable- Returns:
- the return type
-
getParameterTypes
Returns a list of the parameter types ofAbstractExecutableTypewhere the vararg parameter has been replaced by individual parameters so the result has lengthsize.- Parameters:
map- a mapping from type variable to inference variablesize- the number of parameters to return; used to expand the vararg- Returns:
- a list of the parameter types of
AbstractExecutableType, of lengthsize
-
getParameterTypes
Returns the parameter types of this. (Varags are not expanded.)- Parameters:
map- a mapping from type variable to inference variable- Returns:
- the parameter types
-
getParameterTypes
protected final List<AbstractType> getParameterTypes(Theta map, int size, AnnotatedTypeMirror firstParam, boolean isVarargsCall) Returns a list of the parameter types ofInferenceExecutableTypewhere the vararg parameter has been replaced by individual parameters so the result has lengthsize.This is a helper method for
getParameterTypes(Theta, int).- Parameters:
map- a mapping from type variable to inference variablesize- the number of parameters to return; used to expand the varargfirstParam- an extra first parameter to add at the beginning of the returned list, or nullisVarargsCall- true if this invocation is uses varargs- Returns:
- a list of the parameter types of
InferenceExecutableType, of lengthsize
-
hasTypeVariables
public boolean hasTypeVariables()Returns true if this type has type variables.- Returns:
- true if this type has type variables
-
getAnnotatedTypeVariables
Returns the annotated type variables.- Returns:
- the annotated type variables
-
getTypeVariables
Returns the Java type variables.- Returns:
- the Java type variables
-
isVoid
public boolean isVoid()Returns true if this method or constructor has void return type.- Returns:
- true if this method or constructor has void return type
-
getAnnotatedType
Returns the underlying annotated method or constructor type.- Returns:
- the underlying annotated method or constructor type
-