Package org.apache.groovy.ast.tools
Class MethodCallUtils
java.lang.Object
org.apache.groovy.ast.tools.MethodCallUtils
Utility class for commonly called methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatementappendS(Expression result, Expression expr) Creates a statement that appends the supplied expression to the target receiver.static ExpressionmaybeNullToStringX(Expression object) Creates a null-safe expression that rendersnullas the string"null".static ExpressiontoStringX(Expression object) Creates an explicittoString()method call expression.
-
Method Details
-
appendS
Creates a statement that appends the supplied expression to the target receiver.- Parameters:
result- the receiver of theappendcallexpr- the expression to append- Returns:
- a statement wrapping the append call
-
toStringX
Creates an explicittoString()method call expression.- Parameters:
object- the receiver of the call- Returns:
- a
toString()call expression
-
maybeNullToStringX
Creates a null-safe expression that rendersnullas the string"null".- Parameters:
object- the expression to stringify- Returns:
- a conditional stringification expression
-