Package org.jibx.binding.classes
Class InstructionBuilder
InstructionFactory
org.jibx.binding.classes.InstructionBuilder
public class InstructionBuilder
extends InstructionFactory
Instruction builder. Extends the basic instruction construction tools in
BCEL with some convenience methods.
- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInvokeInstruction
createCallInit
(String name, String signature) Create invoke initializer instruction from signature.InvokeInstruction
createCallInterface
(String method, String signature) Create invoke interface method instruction from signature.InvokeInstruction
createCallInterface
(ClassItem item) Create invoke instruction for interface method.InvokeInstruction
createCallStatic
(String method, String signature) Create invoke static method instruction from signature.InvokeInstruction
createCallStatic
(ClassItem item) Create invoke instruction for static method.InvokeInstruction
createCallVirtual
(String method, String signature) Create invoke virtual method instruction from signature.InvokeInstruction
createCallVirtual
(ClassItem item) Create invoke instruction for virtual method.FieldInstruction
createGetField
(ClassItem item) Create getfield instruction.FieldInstruction
createGetStatic
(ClassItem item) Create getstatic instruction.CompoundInstruction
createLoadConstant
(int value) Create load constant instruction.CompoundInstruction
createLoadConstant
(Object value) Create load constant instruction.CompoundInstruction
createLoadConstant
(String value) Create load constant instruction.FieldInstruction
createPutField
(ClassItem item) Create putfield instruction.FieldInstruction
createPutStatic
(ClassItem item) Create putstatic instruction.ConstantPoolGen
Get constant pool generator.
-
Constructor Details
-
InstructionBuilder
public InstructionBuilder(ClassGen cg, ConstantPoolGen cp) Constructor.- Parameters:
cg
- class generation informationcp
- constant pool generator
-
-
Method Details
-
getConstantPoolGen
public ConstantPoolGen getConstantPoolGen()Get constant pool generator.- Returns:
- constant pool generator for class
-
createLoadConstant
public CompoundInstruction createLoadConstant(int value) Create load constant instruction. Builds the most appropriate type of instruction for the value.- Parameters:
value
- constant value to be loaded- Returns:
- generated instruction information
-
createLoadConstant
Create load constant instruction. Loads aString
reference from the constant pool.- Parameters:
value
- constant value to be loaded- Returns:
- generated instruction information
-
createLoadConstant
Create load constant instruction. Loads an unwrapped primitive value or String from the constant pool.- Parameters:
value
- constant value to be loaded- Returns:
- generated instruction information
-
createGetField
Create getfield instruction. Uses the field information to generate the instruction.- Parameters:
item
- information for field to be set- Returns:
- generated instruction information
-
createPutField
Create putfield instruction. Uses the field information to generate the instruction.- Parameters:
item
- information for field to be set- Returns:
- generated instruction information
-
createGetStatic
Create getstatic instruction. Uses the field information to generate the instruction.- Parameters:
item
- information for field to be set- Returns:
- generated instruction information
-
createPutStatic
Create putstatic instruction. Uses the field information to generate the instruction.- Parameters:
item
- information for field to be set- Returns:
- generated instruction information
-
createCallStatic
Create invoke instruction for static method. Uses the method information to generate the instruction.- Parameters:
item
- information for method to be called- Returns:
- generated instruction information
-
createCallVirtual
Create invoke instruction for virtual method. Uses the method information to generate the instruction.- Parameters:
item
- information for method to be called- Returns:
- generated instruction information
-
createCallInterface
Create invoke instruction for interface method. Uses the method information to generate the instruction.- Parameters:
item
- information for method to be called- Returns:
- generated instruction information
-
createCallStatic
Create invoke static method instruction from signature.- Parameters:
method
- fully qualified class and method namesignature
- method signature in standard form- Returns:
- generated instruction information
-
createCallVirtual
Create invoke virtual method instruction from signature.- Parameters:
method
- fully qualified class and method namesignature
- method signature in standard form- Returns:
- generated instruction information
-
createCallInterface
Create invoke interface method instruction from signature.- Parameters:
method
- fully qualified interface and method namesignature
- method signature in standard form- Returns:
- generated instruction information
-
createCallInit
Create invoke initializer instruction from signature.- Parameters:
name
- fully qualified class namesignature
- method signature in standard form- Returns:
- generated instruction information
-