Package org.apache.groovy.ast.tools

# Class MethodCallUtils

java.lang.Object
org.apache.groovy.ast.tools.MethodCallUtils

public class MethodCallUtils extends Object
Utility class for commonly called methods

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Statement`
  `appendS(Expression result, Expression expr)`
  Creates a statement that appends the supplied expression to the target receiver.
  `static Expression`
  `maybeNullToStringX(Expression object)`
  Creates a null-safe expression that renders `null` as the string `"null"`.
  `static Expression`
  `toStringX(Expression object)`
  Creates an explicit `toString()` method call expression.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### appendS

    public static Statement appendS(Expression result, Expression expr)
    Creates a statement that appends the supplied expression to the target receiver.
    Parameters:
      `result` - the receiver of the `append` call
      `expr` - the expression to append
    Returns:
      a statement wrapping the append call

  - ### toStringX

    public static Expression toStringX(Expression object)
    Creates an explicit `toString()` method call expression.
    Parameters:
      `object` - the receiver of the call
    Returns:
      a `toString()` call expression

  - ### maybeNullToStringX

    public static Expression maybeNullToStringX(Expression object)
    Creates a null-safe expression that renders `null` as the string `"null"`.
    Parameters:
      `object` - the expression to stringify
    Returns:
      a conditional stringification expression