public class MethodCaller
extends Object
A helper class to invoke methods more easily in ASM
| Constructor and description |
|---|
protected MethodCaller()
|
MethodCaller(int opcode, Class theClass, String name)Creates a MethodCaller for a specific method invocation. |
MethodCaller(int opcode, Class theClass, String name, int parameterCount)Creates a MethodCaller for a specific method invocation with parameter count. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
call(org.objectweb.asm.MethodVisitor methodVisitor)Generates the method invocation bytecode. |
|
protected Method |
getMethod()Returns the reflected Method for this caller, matching by name and, if specified, by parameter count. |
|
public String |
getMethodDescriptor()Returns the method descriptor for this method call. |
|
public static MethodCaller |
newInterface(Class theClass, String name)Creates a MethodCaller for an interface method. |
|
public static MethodCaller |
newStatic(Class theClass, String name)Creates a MethodCaller for a static method. |
|
public static MethodCaller |
newStatic(Class theClass, String name, int parameterCount)Creates a MethodCaller for a static method with a specific parameter count. |
|
public static MethodCaller |
newVirtual(Class theClass, String name)Creates a MethodCaller for a virtual method. |
Creates a MethodCaller for a specific method invocation.
opcode - the invocation opcodetheClass - the class containing the methodname - the method nameCreates a MethodCaller for a specific method invocation with parameter count.
opcode - the invocation opcodetheClass - the class containing the methodname - the method nameparameterCount - the number of parametersGenerates the method invocation bytecode.
methodVisitor - the method visitor to write toReturns the reflected Method for this caller, matching by name and, if specified, by parameter count.
Returns the method descriptor for this method call.
Creates a MethodCaller for an interface method.
theClass - the interface containing the methodname - the method nameCreates a MethodCaller for a static method.
theClass - the class containing the methodname - the method nameCreates a MethodCaller for a static method with a specific parameter count.
theClass - the class containing the methodname - the method nameparameterCount - the number of parametersCreates a MethodCaller for a virtual method.
theClass - the class containing the methodname - the method nameCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.