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
 
 
 
 
- 
- All Implemented Interfaces:
- MethodCall
 
 public class MethodCallExpression extends Expression implements MethodCall A method call on an object or class
- 
- 
Field SummaryFields Modifier and Type Field Description static ExpressionNO_ARGUMENTS
 - 
Constructor SummaryConstructors Constructor Description MethodCallExpression(Expression objectExpression, java.lang.String method, Expression arguments)MethodCallExpression(Expression objectExpression, Expression method, Expression arguments)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressiongetArguments()GenericsType[]getGenericsTypes()ExpressiongetMethod()java.lang.StringgetMethodAsString()This method returns the method name as String if it is no dynamic calculated method name, but a constant.MethodNodegetMethodTarget()ExpressiongetObjectExpression()ASTNodegetReceiver()java.lang.StringgetText()booleanisImplicitThis()booleanisSafe()booleanisSpreadSafe()booleanisUsingGenerics()voidsetArguments(Expression arguments)voidsetGenericsTypes(GenericsType[] genericsTypes)voidsetImplicitThis(boolean implicitThis)voidsetMethod(Expression method)voidsetMethodTarget(MethodNode mn)Sets a method call target for a direct method call.voidsetObjectExpression(Expression objectExpression)voidsetSafe(boolean safe)voidsetSourcePosition(ASTNode node)Sets the source position using another ASTNode.voidsetSpreadSafe(boolean value)java.lang.StringtoString()ExpressiontransformExpression(ExpressionTransformer transformer)Return a copy of the expression calling the transformer on any nested expressionsvoidvisit(GroovyCodeVisitor visitor)- 
Methods inherited from class org.codehaus.groovy.ast.expr.ExpressiongetType, setType, transformExpressions, transformExpressions
 - 
Methods inherited from class org.codehaus.groovy.ast.AnnotatedNodeaddAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic
 - 
Methods inherited from class org.codehaus.groovy.ast.ASTNodecopyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData
 
- 
 
- 
- 
- 
Field Detail- 
NO_ARGUMENTSpublic static final Expression NO_ARGUMENTS 
 
- 
 - 
Constructor Detail- 
MethodCallExpressionpublic MethodCallExpression(Expression objectExpression, java.lang.String method, Expression arguments) 
 - 
MethodCallExpressionpublic MethodCallExpression(Expression objectExpression, Expression method, Expression arguments) 
 
- 
 - 
Method Detail- 
visitpublic void visit(GroovyCodeVisitor visitor) 
 - 
transformExpressionpublic Expression transformExpression(ExpressionTransformer transformer) Description copied from class:ExpressionReturn a copy of the expression calling the transformer on any nested expressions- Specified by:
- transformExpressionin class- Expression
 
 - 
getArgumentspublic Expression getArguments() - Specified by:
- getArgumentsin interface- MethodCall
 
 - 
setArgumentspublic void setArguments(Expression arguments) 
 - 
getMethodpublic Expression getMethod() 
 - 
setMethodpublic void setMethod(Expression method) 
 - 
getReceiverpublic ASTNode getReceiver() - Specified by:
- getReceiverin interface- MethodCall
 
 - 
getMethodAsStringpublic java.lang.String getMethodAsString() This method returns the method name as String if it is no dynamic calculated method name, but a constant.- Specified by:
- getMethodAsStringin interface- MethodCall
 
 - 
setObjectExpressionpublic void setObjectExpression(Expression objectExpression) 
 - 
getObjectExpressionpublic Expression getObjectExpression() 
 - 
getTextpublic java.lang.String getText() - Specified by:
- getTextin interface- MethodCall
- Overrides:
- getTextin class- ASTNode
 
 - 
isSafepublic 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
 
 - 
setSafepublic void setSafe(boolean safe) 
 - 
isSpreadSafepublic boolean isSpreadSafe() 
 - 
setSpreadSafepublic void setSpreadSafe(boolean value) 
 - 
isImplicitThispublic 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
 
 - 
setImplicitThispublic void setImplicitThis(boolean implicitThis) 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getGenericsTypespublic GenericsType[] getGenericsTypes() 
 - 
setGenericsTypespublic void setGenericsTypes(GenericsType[] genericsTypes) 
 - 
isUsingGenericspublic boolean isUsingGenerics() 
 - 
setMethodTargetpublic 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- the target as MethodNode, mn==null means no target
 
 - 
getMethodTargetpublic MethodNode getMethodTarget() - Returns:
- the target as method node if set
 
 - 
setSourcePositionpublic void setSourcePosition(ASTNode node) Description copied from class:ASTNodeSets 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- Overrides:
- setSourcePositionin class- ASTNode
- Parameters:
- node- - the node used to configure the position information
 
 
- 
 
-