Package org.codehaus.groovy.ast.expr
Class MethodCallExpression
java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.ast.expr.MethodCallExpression
A method call on an object or class
- Version:
- $Revision$
- Author:
- James Strachan
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMethodCallExpression
(Expression objectExpression, String method, Expression arguments) MethodCallExpression
(Expression objectExpression, Expression method, Expression arguments) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.This method returns the method name as String if it is no dynamic calculated method name, but a constant.getText()
boolean
boolean
isSafe()
boolean
boolean
void
setArguments
(Expression arguments) void
setGenericsTypes
(GenericsType[] genericsTypes) void
setImplicitThis
(boolean implicitThis) void
setMetaMethod
(MetaMethod mmeth) Deprecated.void
setMethod
(Expression method) void
Sets a method call target for a direct method call.void
setObjectExpression
(Expression objectExpression) void
setSafe
(boolean safe) void
setSpreadSafe
(boolean value) toString()
transformExpression
(ExpressionTransformer transformer) Return a copy of the expression calling the transformer on any nested expressionsvoid
visit
(GroovyCodeVisitor visitor) Methods inherited from class org.codehaus.groovy.ast.expr.Expression
getType, setType, transformExpressions, transformExpressions
Methods inherited from class org.codehaus.groovy.ast.AnnotatedNode
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic
Methods inherited from class org.codehaus.groovy.ast.ASTNode
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition
-
Field Details
-
NO_ARGUMENTS
-
-
Constructor Details
-
MethodCallExpression
-
MethodCallExpression
-
-
Method Details
-
getMetaMethod
Deprecated. -
visit
-
transformExpression
Description copied from class:Expression
Return a copy of the expression calling the transformer on any nested expressions- Specified by:
transformExpression
in classExpression
- Parameters:
transformer
-
-
getArguments
-
setArguments
-
getMethod
-
setMethod
-
getMethodAsString
This method returns the method name as String if it is no dynamic calculated method name, but a constant. -
setObjectExpression
-
getObjectExpression
-
getText
-
isSafe
public boolean isSafe()- Returns:
- 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
-
setSafe
public void setSafe(boolean safe) -
isSpreadSafe
public boolean isSpreadSafe() -
setSpreadSafe
public void setSpreadSafe(boolean value) -
isImplicitThis
public boolean isImplicitThis()- Returns:
- 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
-
setImplicitThis
public void setImplicitThis(boolean implicitThis) -
toString
-
setMetaMethod
Deprecated. -
getGenericsTypes
-
setGenericsTypes
-
isUsingGenerics
public boolean isUsingGenerics() -
setMethodTarget
Sets a method call target for a direct method call. WARNING: A method call made this way will run outside of the MOP!- Parameters:
mn
- the target as MethodNode, mn==null means no target
-
getMethodTarget
- Returns:
- the target as method node if set
-