Top Description Fields Constructors Methods
javassist.expr

public Class MethodCall

extends Expr
Class Inheritance
Known Direct Subclasses
javassist.expr.ConstructorCall
Imports
javassist.CannotCompileException, .ClassPool, .CtBehavior, .CtClass, .CtMethod, .NotFoundException, javassist.bytecode.BadBytecode, .Bytecode, .CodeAttribute, .CodeIterator, .ConstPool, .Descriptor, .MethodInfo, javassist.compiler.CompileError, .Javac

Method invocation (caller-side expression).

Field Summary

Inherited from javassist.expr.Expr:
currentPoseditediteratorjavaLangObjectmaxLocalsmaxStackthisClassthisMethod

Constructor Summary

AccessConstructor and Description
protected
MethodCall(int pos, CodeIterator i, CtClass declaring, MethodInfo m)

Undocumented constructor.

Method Summary

Modifier and TypeMethod and Description
public String
getClassName()

Returns the class name of the target object, which the method is called on.

protected CtClass
getCtClass()

Returns the class of the target object, which the method is called on.

public String

Returns:

null if this information is not available.
getFileName
()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the method call.

public int

Returns:

-1 if this information is not available.
getLineNumber
()

Overrides javassist.expr.Expr.getLineNumber.

Returns the line number of the source line containing the method call.

public CtMethod
getMethod()

Returns the called method.

public String
getMethodName()

Returns the name of the called method.

private int
public String
getSignature()

Returns the method signature (the parameter types and the return type).

public boolean
isSuper()

Returns true if the called method is of a superclass of the current class.

public CtClass[]
mayThrow()

Overrides javassist.expr.Expr.mayThrow.

Returns the list of exceptions that the expression may throw.

public void
replace(String
a Java statement except try-catch.
statement
)

Implements abstract javassist.expr.Expr.replace.

Replaces the method call with the bytecode derived from the given source text.

public CtBehavior
where()

Overrides javassist.expr.Expr.where.

Returns the method or constructor containing the method-call expression represented by this object.

Inherited from javassist.expr.Expr:
checkResultValueeditedgetConstPoolgetEnclosingClassindexOfBytecodelocalsreplacereplace0runEditorstackstoreStackwithinStatic

Constructor Detail

MethodCallback to summary
protected MethodCall(int pos, CodeIterator i, CtClass declaring, MethodInfo m)

Undocumented constructor. Do not use; internal-use only.

Method Detail

getClassNameback to summary
public String getClassName()

Returns the class name of the target object, which the method is called on.

getCtClassback to summary
protected CtClass getCtClass() throws NotFoundException

Returns the class of the target object, which the method is called on.

getFileNameback to summary
public String getFileName()

Overrides javassist.expr.Expr.getFileName.

Returns the source file containing the method call.

Returns:String

null if this information is not available.

Annotations
@Override
getLineNumberback to summary
public int getLineNumber()

Overrides javassist.expr.Expr.getLineNumber.

Returns the line number of the source line containing the method call.

Returns:int

-1 if this information is not available.

Annotations
@Override
getMethodback to summary
public CtMethod getMethod() throws NotFoundException

Returns the called method.

getMethodNameback to summary
public String getMethodName()

Returns the name of the called method.

getNameAndTypeback to summary
private int getNameAndType(ConstPool cp)
getSignatureback to summary
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
javassist.CtBehavior#getSignature(), javassist.bytecode.Descriptor
isSuperback to summary
public boolean isSuper()

Returns true if the called method is of a superclass of the current class.

mayThrowback to summary
public CtClass[] mayThrow()

Overrides javassist.expr.Expr.mayThrow.

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.

Annotations
@Override
replaceback to summary
public void replace(String statement) throws CannotCompileException

Implements abstract javassist.expr.Expr.replace.

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

a Java statement except try-catch.

Annotations
@Override
whereback to summary
public CtBehavior where()

Overrides javassist.expr.Expr.where.

Returns the method or constructor containing the method-call expression represented by this object.

Annotations
@Override