Class MethodCallUtils

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

public class MethodCallUtils extends Object
Utility class for commonly called methods
  • 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