public class MethodCallExpression extends Expression
A method call on an object or class
Modifiers | Name | Description |
---|---|---|
static Expression |
NO_ARGUMENTS |
Fields inherited from class | Fields |
---|---|
class Expression |
EMPTY_ARRAY |
Type | Name and description |
---|---|
Expression |
arguments |
GenericsType[] |
genericsTypes |
boolean |
implicitThis |
Expression |
method |
MethodNode |
methodTarget |
Expression |
objectExpression |
boolean |
safe |
boolean |
spreadSafe |
Constructor and description |
---|
MethodCallExpression
(Expression objectExpression, String method, Expression arguments) |
MethodCallExpression
(Expression objectExpression, Expression method, Expression arguments) |
Type Params | Return Type | Name and description |
---|---|---|
|
Expression |
getArguments() |
|
GenericsType[] |
getGenericsTypes() |
|
Expression |
getMethod() |
|
String |
getMethodAsString() This method returns the method name as String if it is no dynamic calculated method name, but a constant. |
|
MethodNode |
getMethodTarget() @return the target as method node if set |
|
Expression |
getObjectExpression() |
|
ASTNode |
getReceiver() |
|
String |
getText() |
|
boolean |
isImplicitThis() @return true if no object expression was specified otherwise if some expression was specified for the object on which to evaluate the method then return false |
|
boolean |
isSafe() @return is this a safe method call, i.e. if true then if the source object is null then this method call will return null rather than throwing a null pointer exception |
|
boolean |
isSpreadSafe() |
|
boolean |
isUsingGenerics() |
|
void |
setArguments(Expression arguments) |
|
void |
setGenericsTypes(GenericsType[] genericsTypes) |
|
void |
setImplicitThis(boolean implicitThis) |
|
void |
setMethod(Expression method) |
|
void |
setMethodTarget(MethodNode mn) Sets a method call target for a direct method call. |
|
void |
setObjectExpression(Expression objectExpression) |
|
void |
setSafe(boolean safe) |
|
void |
setSpreadSafe(boolean value) |
|
String |
toString() |
|
Expression |
transformExpression(ExpressionTransformer transformer) |
|
void |
visit(GroovyCodeVisitor visitor) |
Methods inherited from class | Name |
---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, copyNodeMetaData, equals, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, getText, hashCode, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setNodeMetaData, setSourcePosition, visit |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
This method returns the method name as String if it is no dynamic calculated method name, but a constant.
Sets a method call target for a direct method call. WARNING: A method call made this way will run outside of the MOP!
mn
- the target as MethodNode, mn==null means no targetCopyright © 2003-2018 The Apache Software Foundation. All rights reserved.