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` |
    `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> argumentList, Parameter[] para)`
    `` | `public static ArgumentListExpression` | `makeArgumentList(Expression arguments)`
    `` | `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` | `visitArgumentlistExpression(ArgumentListExpression expression)`
    `` | `public void` | `visitArrayExpression(ArrayExpression expression)`
    `` | `public void` | `visitAssertStatement(AssertStatement statement)`
    `` | `public void` | `visitAttributeExpression(AttributeExpression expression)`
    `` | `public void` | `visitBinaryExpression(BinaryExpression expression)`
    `` | `public void` | `visitBitwiseNegationExpression(BitwiseNegationExpression expression)`
    `` | `public void` | `visitBlockStatement(BlockStatement statement)`
    `` | `public void` | `visitBooleanExpression(BooleanExpression expression)`
    `` | `public void` | `visitBreakStatement(BreakStatement statement)`
    `` | `public void` | `visitBytecodeExpression(BytecodeExpression expression)`
    `` | `public void` | `visitCaseStatement(CaseStatement statement)`
    `` | `public void` | `visitCastExpression(CastExpression expression)`
    `` | `public void` | `visitCatchStatement(CatchStatement statement)`
    `` | `public void` | `visitClassExpression(ClassExpression expression)`
    `` | `public void` | `visitClosureExpression(ClosureExpression expression)`
    `` | `public void` | `visitClosureListExpression(ClosureListExpression expression)`
    `` | `public void` | `visitConstantExpression(ConstantExpression expression)`
    `` | `public void` | `visitConstructorCallExpression(ConstructorCallExpression expression)`
    `` | `public void` | `visitContinueStatement(ContinueStatement statement)`
    `` | `public void` | `visitDeclarationExpression(DeclarationExpression expression)`
    `` | `public void` | `visitDoWhileLoop(DoWhileStatement statement)`
    `` | `public void` | `visitEmptyExpression(EmptyExpression expression)`
    `` | `public void` | `visitEmptyStatement(EmptyStatement statement)`
    `` | `public void` | `visitExpressionStatement(ExpressionStatement statement)`
    `` | `public void` | `visitFieldExpression(FieldExpression expression)`
    `` | `public void` | `visitForLoop(ForStatement statement)`
    `` | `public void` | `visitGStringExpression(GStringExpression expression)`
    `` | `public void` | `visitIfElse(IfStatement statement)`
    `` | `public void` | `visitLambdaExpression(LambdaExpression expression)`
    `` | `public void` | `visitListExpression(ListExpression expression)`
    `` | `public void` | `visitMapEntryExpression(MapEntryExpression expression)`
    `` | `public void` | `visitMapExpression(MapExpression expression)`
    `` | `public void` | `visitMethodCallExpression(MethodCallExpression expression)`
    `` | `public void` | `visitMethodPointerExpression(MethodPointerExpression expression)`
    `` | `public void` | `visitMethodReferenceExpression(MethodReferenceExpression expression)`
    `` | `public void` | `visitNotExpression(NotExpression expression)`
    `` | `public void` | `visitPostfixExpression(PostfixExpression expression)`
    `` | `public void` | `visitPrefixExpression(PrefixExpression expression)`
    `` | `public void` | `visitPropertyExpression(PropertyExpression expression)`
    `` | `public void` | `visitRangeExpression(RangeExpression expression)`
    `` | `public void` | `visitReturnStatement(ReturnStatement statement)`
    `` | `public void` | `visitShortTernaryExpression(ElvisOperatorExpression expression)`
    `` | `public void` | `visitSpreadExpression(SpreadExpression expression)`
    `` | `public void` | `visitSpreadMapExpression(SpreadMapExpression expression)`
    `` | `public void` | `visitStaticMethodCallExpression(StaticMethodCallExpression expression)`
    `` | `public void` | `visitSwitch(SwitchStatement statement)`
    `` | `public void` | `visitSynchronizedStatement(SynchronizedStatement statement)`
    `` | `public void` | `visitTernaryExpression(TernaryExpression expression)`
    `` | `public void` | `visitThrowStatement(ThrowStatement statement)`
    `` | `public void` | `visitTryCatchFinally(TryCatchStatement statement)`
    `` | `public void` | `visitTupleExpression(TupleExpression expression)`
    `` | `public void` | `visitUnaryMinusExpression(UnaryMinusExpression expression)`
    `` | `public void` | `visitUnaryPlusExpression(UnaryPlusExpression expression)`
    `` | `public void` | `visitVariableExpression(VariableExpression expression)`
    `` | `public void` | `visitWhileLoop(WhileStatement statement)`
    `` | `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` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### public static final MethodCaller castToVargsArray

    - #### protected final WriterController controller

    - #### 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> argumentList, Parameter[] para)

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

    - #### 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 visitArgumentlistExpression(ArgumentListExpression expression)

    - #### @Override public void visitArrayExpression(ArrayExpression expression)

    - #### @Override public void visitAssertStatement(AssertStatement statement)

    - #### @Override public void visitAttributeExpression(AttributeExpression expression)

    - #### @Override public void visitBinaryExpression(BinaryExpression expression)

    - #### @Override public void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

    - #### @Override public void visitBlockStatement(BlockStatement statement)

    - #### @Override public void visitBooleanExpression(BooleanExpression expression)

    - #### @Override public void visitBreakStatement(BreakStatement statement)

    - #### @Override public void visitBytecodeExpression(BytecodeExpression expression)

    - #### @Override public void visitCaseStatement(CaseStatement statement)

    - #### @Override public void visitCastExpression(CastExpression expression)

    - #### @Override public void visitCatchStatement(CatchStatement statement)

    - #### @Override public void visitClassExpression(ClassExpression expression)

    - #### @Override public void visitClosureExpression(ClosureExpression expression)

    - #### @Override public void visitClosureListExpression(ClosureListExpression expression)

    - #### @Override public void visitConstantExpression(ConstantExpression expression)

    - #### @Override public void visitConstructorCallExpression(ConstructorCallExpression expression)

    - #### @Override public void visitContinueStatement(ContinueStatement statement)

    - #### @Override public void visitDeclarationExpression(DeclarationExpression expression)

    - #### @Override public void visitDoWhileLoop(DoWhileStatement statement)

    - #### @Override public void visitEmptyExpression(EmptyExpression expression)

    - #### public void visitEmptyStatement(EmptyStatement statement)

    - #### @Override public void visitExpressionStatement(ExpressionStatement statement)

    - #### @Override public void visitFieldExpression(FieldExpression expression)

    - #### @Override public void visitForLoop(ForStatement statement)

    - #### @Override public void visitGStringExpression(GStringExpression expression)

    - #### @Override public void visitIfElse(IfStatement statement)

    - #### @Override public void visitLambdaExpression(LambdaExpression expression)

    - #### @Override public void visitListExpression(ListExpression expression)

    - #### @Override public void visitMapEntryExpression(MapEntryExpression expression)

    - #### @Override public void visitMapExpression(MapExpression expression)

    - #### @Override public void visitMethodCallExpression(MethodCallExpression expression)

    - #### @Override public void visitMethodPointerExpression(MethodPointerExpression expression)

    - #### @Override public void visitMethodReferenceExpression(MethodReferenceExpression expression)

    - #### @Override public void visitNotExpression(NotExpression expression)

    - #### @Override public void visitPostfixExpression(PostfixExpression expression)

    - #### @Override public void visitPrefixExpression(PrefixExpression expression)

    - #### @Override public void visitPropertyExpression(PropertyExpression expression)

    - #### @Override public void visitRangeExpression(RangeExpression expression)

    - #### @Override public void visitReturnStatement(ReturnStatement statement)

    - #### @Override public void visitShortTernaryExpression(ElvisOperatorExpression expression)

    - #### @Override public void visitSpreadExpression(SpreadExpression expression)

    - #### @Override public void visitSpreadMapExpression(SpreadMapExpression expression)

    - #### @Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expression)

    - #### @Override public void visitSwitch(SwitchStatement statement)

    - #### @Override public void visitSynchronizedStatement(SynchronizedStatement statement)

    - #### @Override public void visitTernaryExpression(TernaryExpression expression)

    - #### @Override public void visitThrowStatement(ThrowStatement statement)

    - #### @Override public void visitTryCatchFinally(TryCatchStatement statement)

    - #### @Override public void visitTupleExpression(TupleExpression expression)

    - #### @Override public void visitUnaryMinusExpression(UnaryMinusExpression expression)

    - #### @Override public void visitUnaryPlusExpression(UnaryPlusExpression expression)

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

    - #### @Override public void visitWhileLoop(WhileStatement statement)

    - #### 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)