Top Description Fields Constructors Methods
org.codehaus.groovy.ast.expr

public Class MethodCallExpression

extends Expression
implements MethodCall
Class Inheritance
All Implemented Interfaces
org.codehaus.groovy.ast.expr.MethodCall
Known Direct Subclasses
org.codehaus.groovy.classgen.asm.sc.StaticPropertyAccessHelper.PoppingMethodCallExpression
Imports
org.codehaus.groovy.ast.ASTNode, .ClassHelper, .GenericsType, .GroovyCodeVisitor, .MethodNode, java.util.Collections, .List

A method call on an object or class.

Field Summary

Modifier and TypeField and Description
private Expression
private GenericsType[]
private boolean
private Expression
public static final Expression
private Expression
private boolean
private boolean
private MethodNode
private boolean
Inherited from org.codehaus.groovy.ast.expr.Expression:
EMPTY_ARRAY

Constructor Summary

AccessConstructor and Description
public
MethodCallExpression(Expression objectExpression, String method, Expression arguments)

public
MethodCallExpression(Expression objectExpression, Expression method, Expression arguments)

Method Summary

Modifier and TypeMethod and Description
public Expression
public GenericsType[]
public Expression
public String
getMethodAsString()

Implements org.codehaus.groovy.ast.expr.MethodCall.getMethodAsString.

This method returns the method name as String if it is no dynamic calculated method name, but a constant.
public MethodNode

Returns:

the target as method node if set
getMethodTarget
()

public Expression
public ASTNode
public String
public boolean

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
isImplicitThis
()

public boolean

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
isSafe
()

public boolean
public boolean
public void
public void
setGenericsTypes(GenericsType[] genericsTypes)

public void
setImplicitThis(boolean implicitThis)

public void
public void
setMethodTarget(MethodNode
the target as MethodNode, mn==null means no target
mn
)

Sets a method call target for a direct method call.

public void
setObjectExpression(Expression objectExpression)

public void
setSafe(boolean safe)

public void
setSourcePosition(ASTNode
- the node used to configure the position information
node
)

Overrides org.codehaus.groovy.ast.ASTNode.setSourcePosition.

Sets the source position using another ASTNode.
public void
setSpreadSafe(boolean value)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Expression
transformExpression(ExpressionTransformer transformer)

Implements abstract org.codehaus.groovy.ast.expr.Expression.transformExpression.

Return a copy of the expression calling the transformer on any nested expressions
public void
Inherited from org.codehaus.groovy.ast.expr.Expression:
getTypesetTypetransformExpressionstransformExpressions

Field Detail

argumentsback to summary
private Expression arguments
genericsTypesback to summary
private GenericsType[] genericsTypes
implicitThisback to summary
private boolean implicitThis
methodback to summary
private Expression method
NO_ARGUMENTSback to summary
public static final Expression NO_ARGUMENTS
objectExpressionback to summary
private Expression objectExpression
safeback to summary
private boolean safe
spreadSafeback to summary
private boolean spreadSafe
targetback to summary
private MethodNode target
usesGenericsback to summary
private boolean usesGenerics

Constructor Detail

MethodCallExpressionback to summary
public MethodCallExpression(Expression objectExpression, String method, Expression arguments)
MethodCallExpressionback to summary
public MethodCallExpression(Expression objectExpression, Expression method, Expression arguments)

Method Detail

getArgumentsback to summary
public Expression getArguments()

Implements org.codehaus.groovy.ast.expr.MethodCall.getArguments.

getGenericsTypesback to summary
public GenericsType[] getGenericsTypes()
getMethodback to summary
public Expression getMethod()
getMethodAsStringback to summary
public String getMethodAsString()

Implements org.codehaus.groovy.ast.expr.MethodCall.getMethodAsString.

This method returns the method name as String if it is no dynamic calculated method name, but a constant.

getMethodTargetback to summary
public MethodNode getMethodTarget()
Returns:MethodNode

the target as method node if set

getObjectExpressionback to summary
public Expression getObjectExpression()
getReceiverback to summary
public ASTNode getReceiver()

Implements org.codehaus.groovy.ast.expr.MethodCall.getReceiver.

getTextback to summary
public String getText()

Overrides org.codehaus.groovy.ast.ASTNode.getText.

Implements org.codehaus.groovy.ast.expr.MethodCall.getText.

isImplicitThisback to summary
public boolean isImplicitThis()
Returns:boolean

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

isSafeback to summary
public boolean isSafe()
Returns:boolean

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

isSpreadSafeback to summary
public boolean isSpreadSafe()
isUsingGenericsback to summary
public boolean isUsingGenerics()
setArgumentsback to summary
public void setArguments(Expression arguments)
setGenericsTypesback to summary
public void setGenericsTypes(GenericsType[] genericsTypes)
setImplicitThisback to summary
public void setImplicitThis(boolean implicitThis)
setMethodback to summary
public void setMethod(Expression method)
setMethodTargetback to summary
public void setMethodTarget(MethodNode mn)

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:MethodNode

the target as MethodNode, mn==null means no target

setObjectExpressionback to summary
public void setObjectExpression(Expression objectExpression)
setSafeback to summary
public void setSafe(boolean safe)
setSourcePositionback to summary
public void setSourcePosition(ASTNode node)

Overrides org.codehaus.groovy.ast.ASTNode.setSourcePosition.

Doc from org.codehaus.groovy.ast.ASTNode.setSourcePosition.

Sets the source position using another ASTNode. The sourcePosition consists of a line/column pair for the start and a line/column pair for the end of the expression or statement

Parameters
node:ASTNode

- the node used to configure the position information

Annotations
@Override
setSpreadSafeback to summary
public void setSpreadSafe(boolean value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

transformExpressionback to summary
public Expression transformExpression(ExpressionTransformer transformer)

Implements abstract org.codehaus.groovy.ast.expr.Expression.transformExpression.

Doc from org.codehaus.groovy.ast.expr.Expression.transformExpression.

Return a copy of the expression calling the transformer on any nested expressions

visitback to summary
public void visit(GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.ASTNode.visit.