Package org.jboss.weld.util.bytecode
Class BytecodeUtils
- java.lang.Object
-
- org.jboss.weld.util.bytecode.BytecodeUtils
-
public class BytecodeUtils extends Object
utility class for common bytecode operations- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANNOTATION
static String
BOOLEAN_CLASS_DESCRIPTOR
static String
BYTE_CLASS_DESCRIPTOR
static String
CHAR_CLASS_DESCRIPTOR
static String
DOUBLE_CLASS_DESCRIPTOR
static int
ENUM
static String
FLOAT_CLASS_DESCRIPTOR
static String
INT_CLASS_DESCRIPTOR
static String
LONG_CLASS_DESCRIPTOR
static String
SHORT_CLASS_DESCRIPTOR
static String
VOID_CLASS_DESCRIPTOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addLoadInstruction(org.jboss.classfilewriter.code.CodeAttribute code, String type, int variable)
Adds the correct load instruction based on the type descriptorstatic String
getName(String descriptor)
static void
pushClassType(org.jboss.classfilewriter.code.CodeAttribute b, String classType)
Pushes a class type onto the stack from the string representation This can also handle primitives
-
-
-
Field Detail
-
VOID_CLASS_DESCRIPTOR
public static final String VOID_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
BYTE_CLASS_DESCRIPTOR
public static final String BYTE_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
CHAR_CLASS_DESCRIPTOR
public static final String CHAR_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
DOUBLE_CLASS_DESCRIPTOR
public static final String DOUBLE_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
FLOAT_CLASS_DESCRIPTOR
public static final String FLOAT_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
INT_CLASS_DESCRIPTOR
public static final String INT_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
LONG_CLASS_DESCRIPTOR
public static final String LONG_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
SHORT_CLASS_DESCRIPTOR
public static final String SHORT_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
BOOLEAN_CLASS_DESCRIPTOR
public static final String BOOLEAN_CLASS_DESCRIPTOR
- See Also:
- Constant Field Values
-
ENUM
public static final int ENUM
- See Also:
- Constant Field Values
-
ANNOTATION
public static final int ANNOTATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
addLoadInstruction
public static void addLoadInstruction(org.jboss.classfilewriter.code.CodeAttribute code, String type, int variable)
Adds the correct load instruction based on the type descriptor- Parameters:
code
- the bytecode to add the instruction totype
- the type of the variablevariable
- the variable number
-
pushClassType
public static void pushClassType(org.jboss.classfilewriter.code.CodeAttribute b, String classType)
Pushes a class type onto the stack from the string representation This can also handle primitives- Parameters:
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; form
-
-