public class MethodBuilder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object |
LOAD_ARG_ARRAY |
static java.lang.Object |
LOAD_THIS |
| Constructor and Description |
|---|
MethodBuilder(org.objectweb.asm.commons.GeneratorAdapter mv,
int access) |
| Modifier and Type | Method and Description |
|---|---|
org.objectweb.asm.Type |
box(org.objectweb.asm.Type type)
Boxes the value on the top of the stack if the type is a primitive.
|
static org.objectweb.asm.Type |
getBoxedType(org.objectweb.asm.Type type)
Returns the object type for a primitive type.
|
org.objectweb.asm.commons.GeneratorAdapter |
getGeneratorAdapter() |
MethodBuilder |
invokeInvocationHandlerInterface(boolean popTheReturnValue)
Invokes
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[]) |
MethodBuilder |
loadArray(java.lang.Class<?> arrayClass,
java.lang.Object... objects)
Creates an array containing the objects passed in.
|
MethodBuilder |
loadInvocationHandlerFromProxy()
Loads the AgentWrapper onto the stack by getting it from
AgentBridge.agentHandler |
MethodBuilder |
loadInvocationHandlerProxyAndMethod(java.lang.Object value)
Loads the first two arguments to a
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])
call onto the stack. |
MethodBuilder |
loadSuccessful()
Calls
loadInvocationHandlerProxyAndMethod(Object) with the
AgentWrapper.SUCCESSFUL_METHOD_INVOCATION flag. |
MethodBuilder |
loadUnsuccessful()
Calls
loadInvocationHandlerProxyAndMethod(Object) with the
AgentWrapper.UNSUCCESSFUL_METHOD_INVOCATION flag. |
MethodBuilder |
pushAndBox(java.lang.Object value) |
public static final java.lang.Object LOAD_THIS
public static final java.lang.Object LOAD_ARG_ARRAY
public MethodBuilder(org.objectweb.asm.commons.GeneratorAdapter mv,
int access)
public org.objectweb.asm.commons.GeneratorAdapter getGeneratorAdapter()
public MethodBuilder loadInvocationHandlerFromProxy()
AgentBridge.agentHandlerpublic MethodBuilder invokeInvocationHandlerInterface(boolean popTheReturnValue)
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])popTheReturnValue - if true, the return value of the invoke call will be popped off the stackpublic MethodBuilder loadInvocationHandlerProxyAndMethod(java.lang.Object value)
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])
call onto the stack. The given value is loaded as the first argument, and the second argument (Method) is always
null.public MethodBuilder loadArray(java.lang.Class<?> arrayClass, java.lang.Object... objects)
Runnable,
Runnable.run() will we invoked to push a value onto the stack.
There is built in support for Integers and Booleans. An array object may also be one of the special identifiers
on this class like LOAD_THIS or LOAD_ARG_ARRAY.arrayClass - Class of array to create.objects - public MethodBuilder pushAndBox(java.lang.Object value)
public MethodBuilder loadSuccessful()
loadInvocationHandlerProxyAndMethod(Object) with the
AgentWrapper.SUCCESSFUL_METHOD_INVOCATION flag.public MethodBuilder loadUnsuccessful()
loadInvocationHandlerProxyAndMethod(Object) with the
AgentWrapper.UNSUCCESSFUL_METHOD_INVOCATION flag.public org.objectweb.asm.Type box(org.objectweb.asm.Type type)
Integer.valueOf(int),
Boolean.valueOf(boolean)public static org.objectweb.asm.Type getBoxedType(org.objectweb.asm.Type type)
type -