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 TypeMethodDescriptionInvokeInstructioncreateCallInit(String name, String signature) Create invoke initializer instruction from signature.InvokeInstructioncreateCallInterface(String method, String signature) Create invoke interface method instruction from signature.InvokeInstructioncreateCallInterface(ClassItem item) Create invoke instruction for interface method.InvokeInstructioncreateCallStatic(String method, String signature) Create invoke static method instruction from signature.InvokeInstructioncreateCallStatic(ClassItem item) Create invoke instruction for static method.InvokeInstructioncreateCallVirtual(String method, String signature) Create invoke virtual method instruction from signature.InvokeInstructioncreateCallVirtual(ClassItem item) Create invoke instruction for virtual method.FieldInstructioncreateGetField(ClassItem item) Create getfield instruction.FieldInstructioncreateGetStatic(ClassItem item) Create getstatic instruction.CompoundInstructioncreateLoadConstant(int value) Create load constant instruction.CompoundInstructioncreateLoadConstant(Object value) Create load constant instruction.CompoundInstructioncreateLoadConstant(String value) Create load constant instruction.FieldInstructioncreatePutField(ClassItem item) Create putfield instruction.FieldInstructioncreatePutStatic(ClassItem item) Create putstatic instruction.ConstantPoolGenGet 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 aStringreference 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
-