javassist.expr
Class MethodCall
public
class
MethodCall
extends Expr
Method invocation (caller-side expression).
Method Summary |
String | getClassName()
Returns the class name of the target object,
which the method is called on. |
String | getFileName()
Returns the source file containing the method call.
|
int | getLineNumber()
Returns the line number of the source line containing the
method call.
|
CtMethod | getMethod()
Returns the called method. |
String | getMethodName()
Returns the name of the called method. |
String | getSignature()
Returns the method signature (the parameter types
and the return type).
|
boolean | isSuper()
Returns true if the called method is of a superclass of the current
class. |
CtClass[] | mayThrow()
Returns the list of exceptions that the expression may throw.
|
void | replace(String statement)
Replaces the method call with the bytecode derived from
the given source text.
|
CtBehavior | where()
Returns the method or constructor containing the method-call
expression represented by this object. |
public String getClassName()
Returns the class name of the target object,
which the method is called on.
public String getFileName()
Returns the source file containing the method call.
Returns: null if this information is not available.
public int getLineNumber()
Returns the line number of the source line containing the
method call.
Returns: -1 if this information is not available.
Returns the called method.
public String getMethodName()
Returns the name of the called method.
public String getSignature()
Returns the method signature (the parameter types
and the return type).
The method signature is represented by a character string
called method descriptor, which is defined in the JVM specification.
Since: 3.1
See Also: getSignature Descriptor
public boolean isSuper()
Returns true if the called method is of a superclass of the current
class.
Returns the list of exceptions that the expression may throw.
This list includes both the exceptions that the try-catch statements
including the expression can catch and the exceptions that
the throws declaration allows the method to throw.
public void replace(String statement)
Replaces the method call with the bytecode derived from
the given source text.
$0 is available even if the called method is static.
Parameters: statement a Java statement.
Returns the method or constructor containing the method-call
expression represented by this object.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.