public class MethodReferenceExpression
extends MethodPointerExpression
Represents a method reference or a constructor reference, e.g. System.out::println OR Objects::requireNonNull OR Integer::new OR int[]::new
| Fields inherited from class | Fields |
|---|---|
class MethodPointerExpression |
expression, methodName |
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
MethodReferenceExpression(Expression expression, Expression methodName)Creates a method or constructor reference. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getText() |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class MethodPointerExpression |
getExpression, getMethodName, getText, getTypeClass, isDynamic, transformExpression, visit |
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Creates a method or constructor reference.
A null expression is stored as null and read back as this
by MethodPointerExpression.getExpression. The expression type is
a plain closure reference.
expression - the receiver, or null for an implicit thismethodName - the referenced method name, including new for a constructorCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.