InvocationWriter (Groovy 5.0.8)

Package: org.codehaus.groovy.classgen.asm

## [Java] Class InvocationWriter

- org.codehaus.groovy.classgen.asm.InvocationWriter

-     public class InvocationWriter
      extends Object

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static MethodCaller` | `castToVargsArray` |
    `protected WriterController` | `controller` |
    `protected Expression` | `currentCall` |
    `static MethodCaller` | `invokeClosureMethod` |
    `static MethodCallerMultiAdapter` | `invokeMethod` |
    `static MethodCallerMultiAdapter` | `invokeMethodOnCurrent` |
    `static MethodCallerMultiAdapter` | `invokeMethodOnSuper` |
    `static MethodCallerMultiAdapter` | `invokeStaticMethod` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `InvocationWriter(WriterController controller)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `castNonPrimitiveToBool(ClassNode last)`
    `` | `public void` | `castToNonPrimitiveIfNecessary(ClassNode sourceType, ClassNode targetType)` Converts sourceType to a non-primitive by using Groovy casting.
    `` | `public void` | `coerce(ClassNode from, ClassNode target)`
    `` | `protected void` | `finnishConstructorCall(ConstructorNode cn, String ownerDescriptor, int argsToRemove)`
    `` | `protected String` | `getMethodName(Expression message)`
    `` | `protected void` | `loadArguments(List<Expression> arguments, Parameter[] parameters)`
    `` | `public static ArgumentListExpression` | `makeArgumentList(Expression arguments)` Converts an expression to an argument list.
    `` | `protected boolean` | `makeCachedCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis, boolean containsSpreadExpression)`
    `` | `public void` | `makeCall(Expression origin, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis)`
    `` | `protected void` | `makeCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis)`
    `` | `protected boolean` | `makeClassForNameCall(Expression origin, Expression receiver, Expression message, Expression arguments)` if Class.forName(x) is recognized, make a direct method call
    `` | `protected boolean` | `makeDirectCall(Expression origin, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean implicitThis, boolean containsSpreadExpression)`
    `` | `public final void` | `makeSingleArgumentCall(Expression receiver, String message, Expression arguments)`
    `` | `public void` | `makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe)`
    `` | `protected void` | `makeUncachedCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis, boolean containsSpreadExpression)`
    `` | `protected String` | `prepareConstructorCall(ConstructorNode cn)`
    `` | `public void` | `visitVariableExpression(VariableExpression vexp)`
    `` | `protected boolean` | `writeAICCall(ConstructorCallExpression call)`
    `` | `protected boolean` | `writeDirectMethodCall(MethodNode target, boolean implicitThis, Expression receiver, TupleExpression args)`
    `` | `public void` | `writeInvokeConstructor(ConstructorCallExpression call)`
    `` | `public void` | `writeInvokeMethod(MethodCallExpression call)`
    `` | `public void` | `writeInvokeStaticMethod(StaticMethodCallExpression call)`
    `` | `protected void` | `writeNormalConstructorCall(ConstructorCallExpression call)`
    `` | `public void` | `writeSpecialConstructorCall(ConstructorCallExpression call)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final MethodCaller castToVargsArray

    - #### protected final WriterController controller

    - #### protected Expression currentCall

    - #### @Deprecated(since = "5.0.0")
      public static final MethodCaller invokeClosureMethod

    - #### public static final MethodCallerMultiAdapter invokeMethod

    - #### public static final MethodCallerMultiAdapter invokeMethodOnCurrent

    - #### public static final MethodCallerMultiAdapter invokeMethodOnSuper

    - #### public static final MethodCallerMultiAdapter invokeStaticMethod

  - ### Constructor Detail

    - #### public InvocationWriter(WriterController controller)

  - ### Method Detail

    - #### public void castNonPrimitiveToBool(ClassNode last)

    - #### public void castToNonPrimitiveIfNecessary(ClassNode sourceType, ClassNode targetType)

      Converts sourceType to a non-primitive by using Groovy casting. sourceType might be a primitive This might be done using SBA#castToType

    - #### public void coerce(ClassNode from, ClassNode target)

    - #### protected void finnishConstructorCall(ConstructorNode cn, String ownerDescriptor, int argsToRemove)

    - #### protected String getMethodName(Expression message)

    - #### protected void loadArguments(List<Expression> arguments, Parameter[] parameters)

    - #### public static ArgumentListExpression makeArgumentList(Expression arguments)

      Converts an expression to an argument list.

      Returns:
        `arguments` if already an argument list or an argument list of the expression or expressions (in case of a tuple expression).
      Since:
        2.0.0

    - #### protected boolean makeCachedCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis, boolean containsSpreadExpression)

    - #### public void makeCall(Expression origin, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis)

    - #### protected void makeCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis)

    - #### protected boolean makeClassForNameCall(Expression origin, Expression receiver, Expression message, Expression arguments)

      if Class.forName(x) is recognized, make a direct method call

    - #### protected boolean makeDirectCall(Expression origin, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean implicitThis, boolean containsSpreadExpression)

    - #### public final void makeSingleArgumentCall(Expression receiver, String message, Expression arguments)

    - #### public void makeSingleArgumentCall(Expression receiver, String message, Expression arguments, boolean safe)

    - #### protected void makeUncachedCall(Expression origin, ClassExpression sender, Expression receiver, Expression message, Expression arguments, MethodCallerMultiAdapter adapter, boolean safe, boolean spreadSafe, boolean implicitThis, boolean containsSpreadExpression)

    - #### protected String prepareConstructorCall(ConstructorNode cn)

    - #### @Override
      public void visitVariableExpression(VariableExpression vexp)

    - #### protected boolean writeAICCall(ConstructorCallExpression call)

    - #### protected boolean writeDirectMethodCall(MethodNode target, boolean implicitThis, Expression receiver, TupleExpression args)

    - #### public void writeInvokeConstructor(ConstructorCallExpression call)

    - #### public void writeInvokeMethod(MethodCallExpression call)

    - #### public void writeInvokeStaticMethod(StaticMethodCallExpression call)

    - #### protected void writeNormalConstructorCall(ConstructorCallExpression call)

    - #### public void writeSpecialConstructorCall(ConstructorCallExpression call)