public class BytecodeUtils extends Object
Constructor and Description |
---|
BytecodeUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
add16bit(javassist.bytecode.Bytecode b,
int value)
inserts a 16 bit offset into the bytecode
|
static void |
addLoadInstruction(javassist.bytecode.Bytecode code,
String type,
int variable)
Adds the correct load instruction based on the type descriptor
|
static void |
addReturnInstruction(javassist.bytecode.Bytecode code,
Class<?> type) |
static void |
addReturnInstruction(javassist.bytecode.Bytecode code,
String type)
Adds a return instruction given a type in JVM format.
|
static int |
loadParameters(javassist.bytecode.Bytecode b,
String descriptor)
Push all parameters onto the stack, excluding the this pointer (variable
0).
|
static int |
loadParameters(javassist.bytecode.Bytecode b,
String[] params)
Push all parameters onto the stack, excluding the this pointer (variable
0).
|
static void |
pushClassType(javassist.bytecode.Bytecode b,
String classType)
Pushes a class type onto the stack from the string representation This can
also handle primitives
|
public static int loadParameters(javassist.bytecode.Bytecode b, String descriptor)
public static int loadParameters(javassist.bytecode.Bytecode b, String[] params)
public static void addLoadInstruction(javassist.bytecode.Bytecode code, String type, int variable)
code
- the bytecode to add the instruction totype
- the type of the variablevariable
- the variable numberpublic static void addReturnInstruction(javassist.bytecode.Bytecode code, Class<?> type)
public static void addReturnInstruction(javassist.bytecode.Bytecode code, String type)
code
- the bytecodetype
- the type descriptor for the type to returnpublic static void pushClassType(javassist.bytecode.Bytecode b, String classType)
b
- the bytecodeclassType
- the type descriptor for the class or primitive to push.
This will accept both the java.lang.Object form and the
Ljava/lang/Object; formpublic static void add16bit(javassist.bytecode.Bytecode b, int value)
b
- value
- Copyright © 2012 Seam Framework. All Rights Reserved.