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 intANNOTATIONstatic StringBOOLEAN_CLASS_DESCRIPTORstatic StringBYTE_CLASS_DESCRIPTORstatic StringCHAR_CLASS_DESCRIPTORstatic StringDOUBLE_CLASS_DESCRIPTORstatic intENUMstatic StringFLOAT_CLASS_DESCRIPTORstatic StringINT_CLASS_DESCRIPTORstatic StringLONG_CLASS_DESCRIPTORstatic StringSHORT_CLASS_DESCRIPTORstatic StringVOID_CLASS_DESCRIPTOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddLoadInstruction(org.jboss.classfilewriter.code.CodeAttribute code, String type, int variable)Adds the correct load instruction based on the type descriptorstatic StringgetName(String descriptor)static voidpushClassType(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
-
-