Package: org.codehaus.groovy.transform.stc

## [Java] Class GroovyTypeCheckingExtensionSupport

- org.codehaus.groovy.transform.stc.GroovyTypeCheckingExtensionSupport

- Base class for type checking extensions written in Groovy. Compared to its superclass, TypeCheckingExtension, this class adds a number of utility methods aimed at leveraging the syntax of the Groovy language to improve expressivity and conciseness.

  Since:
    2.1.0

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `GroovyTypeCheckingExtensionSupport.TypeCheckingDSL` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractTypeCheckingExtension` | `context, debug, handled`
    `class TypeCheckingExtension` | `typeCheckingVisitor`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyTypeCheckingExtensionSupport (StaticTypeCheckingVisitor typeCheckingVisitor, String scriptPath, org.codehaus.groovy.control.CompilationUnit compilationUnit)` Builds a type checking extension relying on a Groovy script (type checking DSL).

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `afterMethodCall(MethodCall call)`
    `` | `void` | `afterVisitClass(ClassNode node)`
    `` | `void` | `afterVisitMethod(MethodNode node)`
    `` | `boolean` | `beforeMethodCall(MethodCall call)`
    `` | `boolean` | `beforeVisitClass(ClassNode node)`
    `` | `boolean` | `beforeVisitMethod(MethodNode node)`
    `` | `void` | `finish()`
    `` | `List<MethodNode>` | `handleAmbiguousMethods(List<MethodNode> nodes, Expression origin)`
    `` | `boolean` | `handleIncompatibleAssignment(ClassNode lhsType, ClassNode rhsType, Expression assignmentExpression)`
    `` | `boolean` | `handleIncompatibleReturnType(ReturnStatement returnStatement, ClassNode inferredReturnType)`
    `` | `List<MethodNode>` | `handleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)`
    `` | `boolean` | `handleUnresolvedAttribute(AttributeExpression aexp)`
    `` | `boolean` | `handleUnresolvedProperty(PropertyExpression pexp)`
    `` | `boolean` | `handleUnresolvedVariableExpression(VariableExpression vexp)`
    `` | `void` | `onMethodSelection(Expression expression, MethodNode target)`
    `` | `void` | `setDebug(boolean debug)`
    `` | `void` | `setup()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractTypeCheckingExtension` | `argTypeMatches, argTypeMatches, argTypesMatches, argTypesMatches, delegatesTo, delegatesTo, delegatesTo, firstArgTypesMatches, firstArgTypesMatches, getArguments, getCurrentScope, getEnclosingBinaryExpression, getEnclosingBinaryExpressionStack, getEnclosingClassNode, getEnclosingClassNodes, getEnclosingClosure, getEnclosingClosureStack, getEnclosingMethod, getEnclosingMethodCall, getEnclosingMethodCalls, getEnclosingMethods, getGeneratedMethods, isAnnotatedBy, isAnnotatedBy, isDynamic, isExtensionMethod, isGenerated, isMethodCall, log, makeDynamic, makeDynamic, makeDynamic, makeDynamic, makeDynamic, makeDynamic, newMethod, newMethod, newMethod, newScope, newScope, popEnclosingBinaryExpression, popEnclosingClassNode, popEnclosingClosure, popEnclosingMethod, popEnclosingMethodCall, popTemporaryTypeInfo, pushEnclosingBinaryExpression, pushEnclosingClassNode, pushEnclosingClosureExpression, pushEnclosingMethod, pushEnclosingMethodCall, pushTemporaryTypeInfo, safeCall, scopeExit, scopeExit, setHandled, unique, withTypeChecker`
    `class TypeCheckingExtension` | `addStaticTypeError, afterMethodCall, afterVisitClass, afterVisitMethod, beforeMethodCall, beforeVisitClass, beforeVisitMethod, buildListType, buildMapType, classNodeFor, classNodeFor, existsProperty, existsProperty, extractStaticReceiver, finish, getArgumentTypes, getTargetMethod, getType, handleAmbiguousMethods, handleIncompatibleAssignment, handleIncompatibleReturnType, handleMissingMethod, handleUnresolvedAttribute, handleUnresolvedProperty, handleUnresolvedVariableExpression, isStaticMethodCallOnClass, lookupClassNodeFor, onMethodSelection, parameterizedType, setup, storeType`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public GroovyTypeCheckingExtensionSupport(StaticTypeCheckingVisitor typeCheckingVisitor, String scriptPath, org.codehaus.groovy.control.CompilationUnit compilationUnit)

      Builds a type checking extension relying on a Groovy script (type checking DSL).

      Parameters:
        `typeCheckingVisitor` - the type checking visitor
        `scriptPath` - the path to the type checking script (in classpath)
        compilationUnit

  - ### Method Detail

    - #### @Override public void afterMethodCall(MethodCall call)

    - #### @Override public void afterVisitClass(ClassNode node)

    - #### @Override public void afterVisitMethod(MethodNode node)

    - #### @Override public boolean beforeMethodCall(MethodCall call)

    - #### @Override public boolean beforeVisitClass(ClassNode node)

    - #### @Override public boolean beforeVisitMethod(MethodNode node)

    - #### @Override public void finish()

    - #### @Override @SuppressWarnings("unchecked") public List<MethodNode> handleAmbiguousMethods(List<MethodNode> nodes, Expression origin)

    - #### @Override public boolean handleIncompatibleAssignment(ClassNode lhsType, ClassNode rhsType, Expression assignmentExpression)

    - #### @Override public boolean handleIncompatibleReturnType(ReturnStatement returnStatement, ClassNode inferredReturnType)

    - #### @Override @SuppressWarnings("unchecked") public List<MethodNode> handleMissingMethod(ClassNode receiver, String name, ArgumentListExpression argumentList, ClassNode[] argumentTypes, MethodCall call)

    - #### @Override public boolean handleUnresolvedAttribute(AttributeExpression aexp)

    - #### @Override public boolean handleUnresolvedProperty(PropertyExpression pexp)

    - #### @Override public boolean handleUnresolvedVariableExpression(VariableExpression vexp)

    - #### @Override public void onMethodSelection(Expression expression, MethodNode target)

    - #### public void setDebug(boolean debug)

    - #### @Override public void setup()