public class JMethodCall extends JExpression
Constructor and Description |
---|
JMethodCall(JMethodCall other,
JExpression instance)
Initialize a new method call equivalent to another one.
|
JMethodCall(SourceInfo info,
JExpression instance,
JMethod method) |
JMethodCall(SourceInfo info,
JExpression instance,
JMethod method,
JType overrideReturnType)
Create a method call whose type is overridden to the specified type,
ignoring the return type of the target method.
|
Modifier and Type | Method and Description |
---|---|
void |
addArg(int index,
JExpression toAdd)
Inserts an argument at the specified index.
|
void |
addArg(JExpression toAdd)
Adds an argument to this method.
|
void |
addArgs(JExpression... toAdd)
Adds an argument to this method.
|
void |
addArgs(List<JExpression> toAdd)
Adds arguments to this method.
|
boolean |
canBePolymorphic()
Returns
true if the call can dispatch to more than possible
target method. |
List<JExpression> |
getArgs()
Returns the call arguments.
|
JExpression |
getInstance() |
JMethod |
getTarget() |
JType |
getType()
Returns the type of this expression.
|
boolean |
hasSideEffects() |
boolean |
isStaticDispatchOnly()
Returns
true for calls that must be called statically,
e.g. |
boolean |
isVolatile()
Returns
true for calls that should not be optimized. |
void |
removeArg(int index)
Removes the argument at the specified index.
|
void |
resolve(JMethod newMethod)
Resolve an external reference during AST stitching.
|
void |
setArg(int index,
JExpression arg)
Sets the argument at the specified index.
|
void |
setCannotBePolymorphic()
See
canBePolymorphic() . |
void |
setStaticDispatchOnly()
|
void |
setVolatile()
See
isVolatile() . |
void |
traverse(JVisitor visitor,
Context ctx)
Causes this object to have the visitor visit itself and its children.
|
protected void |
visitChildren(JVisitor visitor) |
makeStatement
getSourceInfo, setSourceInfo, toSource, toString
public JMethodCall(JMethodCall other, JExpression instance)
public JMethodCall(SourceInfo info, JExpression instance, JMethod method)
public JMethodCall(SourceInfo info, JExpression instance, JMethod method, JType overrideReturnType)
public void addArg(int index, JExpression toAdd)
public void addArg(JExpression toAdd)
public void addArgs(JExpression... toAdd)
public void addArgs(List<JExpression> toAdd)
public boolean canBePolymorphic()
true
if the call can dispatch to more than possible
target method.public List<JExpression> getArgs()
public JExpression getInstance()
public JMethod getTarget()
public JType getType()
HasType
public boolean hasSideEffects()
hasSideEffects
in class JExpression
public boolean isStaticDispatchOnly()
true
for calls that must be called statically,
e.g. super.method() invocations, and super() and this() constructor calls.public boolean isVolatile()
true
for calls that should not be optimized.public void removeArg(int index)
public void resolve(JMethod newMethod)
public void setArg(int index, JExpression arg)
public void setCannotBePolymorphic()
canBePolymorphic()
.public void setStaticDispatchOnly()
public void setVolatile()
isVolatile()
.public void traverse(JVisitor visitor, Context ctx)
JVisitable
visitor
- the visitor that should traverse this nodectx
- the context of an existing traversalprotected void visitChildren(JVisitor visitor)
Copyright © 2018. All rights reserved.