Class AbstractExecutableType

java.lang.Object
org.checkerframework.framework.util.typeinference8.types.AbstractExecutableType
Direct Known Subclasses:
AbstractInvocationType, CompileTimeDeclarationType

public abstract class AbstractExecutableType extends Object
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 Details

  • 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 type
      executableType - the underlying Java method or constructor type. This must be an argument to the constructor, because it is not always equal to annotatedExecutableType.getUnderlyingType().
      invocation - a method or constructor invocation
      context - the context
  • Method Details

    • getJavaType

      public ExecutableType getJavaType()
      Returns the Java method or constructor type.
      Returns:
      the Java method or constructor type
    • getThrownTypes

      public List<? extends AbstractType> getThrownTypes(Theta map)
      Returns the thrown types of this.
      Parameters:
      map - a mapping from type variable to inference variable
      Returns:
      the thrown types
    • getReturnType

      public abstract AbstractType getReturnType(Theta map)
      Returns the return type of this.
      Parameters:
      map - a mapping from type variable to inference variable
      Returns:
      the return type
    • getParameterTypes

      public abstract List<AbstractType> getParameterTypes(Theta map, int size)
      Returns a list of the parameter types of AbstractExecutableType where the vararg parameter has been replaced by individual parameters so the result has length size.
      Parameters:
      map - a mapping from type variable to inference variable
      size - the number of parameters to return; used to expand the vararg
      Returns:
      a list of the parameter types of AbstractExecutableType, of length size
    • getParameterTypes

      public List<AbstractType> getParameterTypes(Theta map)
      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 of InferenceExecutableType where the vararg parameter has been replaced by individual parameters so the result has length size.

      This is a helper method for getParameterTypes(Theta, int).

      Parameters:
      map - a mapping from type variable to inference variable
      size - the number of parameters to return; used to expand the vararg
      firstParam - an extra first parameter to add at the beginning of the returned list, or null
      isVarargsCall - true if this invocation is uses varargs
      Returns:
      a list of the parameter types of InferenceExecutableType, of length size
    • hasTypeVariables

      public boolean hasTypeVariables()
      Returns true if this type has type variables.
      Returns:
      true if this type has type variables
    • getAnnotatedTypeVariables

      public List<? extends AnnotatedTypeMirror.AnnotatedTypeVariable> getAnnotatedTypeVariables()
      Returns the annotated type variables.
      Returns:
      the annotated type variables
    • getTypeVariables

      public List<? extends TypeVariable> 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