Top Description Interfaces Classes
[default module]

Package org.apache.bcel.generic


Generic part of the Apache Byte Code Engineering Library (BCEL), classes to dynamically modify class objects and byte code instructions.

Interface Summary

Modifier and TypeInterface and Description
public interface
AllocationInstruction

Denote family of instructions that allocates space in the heap.

public interface
ClassObserver

Implement this interface if you're interested in changes to a ClassGen object and register yourself with addObserver().

public interface
CompoundInstruction

Wrapper class for 'compound' operations, virtual instructions that don't exist as byte code, but give a useful meaning.

public interface
ConstantPushInstruction

Denotes a push instruction that produces a literal on the stack such as SIPUSH, BIPUSH, ICONST, etc.

public interface
ExceptionThrower

Denote an instruction that may throw a run-time or a linking exception (or both) during execution.

public interface
FieldObserver

Imnplement this interface if you're interested in changes to a FieldGen object and register yourself with addObserver().

public interface
IndexedInstruction

Denote entity that refers to an index, e.g. local variable instructions, RET, CPInstruction, etc.

public interface
InstructionComparator

Equality of instructions isn't clearly to be defined.

public interface
InstructionConstants

Deprecated (since 6.0) Do not use. Use InstructionConst instead.
Contains shareable instruction objects.
public interface
InstructionListObserver

Implement this interface if you're interested in changes to an InstructionList object and register yourself with addObserver().

public interface
InstructionTargeter

Denote that a class targets InstructionHandles within an InstructionList.

public interface
LoadClass

Denotes that an instruction may start the process of loading and resolving the referenced class in the Virtual Machine.

public interface
MethodObserver

Implement this interface if you're interested in changes to a MethodGen object and register yourself with addObserver().

public interface
NamedAndTyped

Denote entity that has both name and type.

public interface
PopInstruction

Denotes an unparameterized instruction to pop a value on top from the stack, such as ISTORE, POP, PUTSTATIC.

public interface
PushInstruction

Denotes an unparameterized instruction to produce a value on top of the stack, such as ILOAD, LDC, SIPUSH, DUP, ICONST, etc.

public interface
StackConsumer

Denote an instruction that may consume a value from the stack.

public interface
StackProducer

Denotes an instruction that may produce a value on top of the stack (this excludes DUP_X1, e.g.)

public interface
TypedInstruction

Gets the type associated with an instruction, int for ILOAD, or the type of the field of a PUTFIELD instruction, e.g..

public interface
UnconditionalBranch

Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR.

public interface
VariableLengthInstruction

Denotes an instruction to be a variable length instruction, such as GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.

public interface
Visitor

Interface implementing the Visitor pattern programming style.

Class Summary

Modifier and TypeClass and Description
public class
AALOAD

AALOAD - Load reference from array

Stack: ..., arrayref, index -> value
public class
AASTORE

AASTORE - Store into reference array

Stack: ..., arrayref, index, value -> ...
public class
ACONST_NULL

ACONST_NULL - Push null reference

Stack: ...
public class
ALOAD

ALOAD - Load reference from local variable

Stack: ...
public class
ANEWARRAY

ANEWARRAY - Create new array of references

Stack: ..., count -> ..., arrayref
public class
public class
public class
ARETURN

ARETURN - Return reference from method

Stack: ..., objectref -> <empty>
public abstract class
ArithmeticInstruction

Super class for the family of arithmetic instructions.

public class
public abstract class
ArrayInstruction

Super class for instructions dealing with array access such as IALOAD.

public class
ARRAYLENGTH

ARRAYLENGTH - Get length of array

Stack: ..., arrayref -> ..., length
public class
ArrayType

Denotes array type, such as int[][]

public class
ASTORE

ASTORE - Store reference into local variable

Stack ..., objectref -> ...
public class
ATHROW

ATHROW - Throw exception

Stack: ..., objectref -> objectref
public class
BALOAD

BALOAD - Load byte or boolean from array

Stack: ..., arrayref, index -> ..., value
public class
BasicType

Denotes basic type such as int.

public class
BASTORE

BASTORE - Store into byte or boolean array

Stack: ..., arrayref, index, value -> ...
public class
BIPUSH

BIPUSH - Push byte on stack

Stack: ...
public class
BranchHandle

BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended.

public abstract class
BranchInstruction

Abstract super class for branching instructions like GOTO, IFEQ, etc..

public class
BREAKPOINT

BREAKPOINT, JVM dependent, ignored by default

public class
CALOAD

CALOAD - Load char from array

Stack: ..., arrayref, index -> ..., value
public class
CASTORE

CASTORE - Store into char array

Stack: ..., arrayref, index, value -> ...
public class
CHECKCAST

CHECKCAST - Check whether object is of given type

Stack: ..., objectref -> ..., objectref
public class
public class
ClassGen

Template class for building up a java class.

public class
ClassGenException

Thrown on internal exceptions.

public class
CodeExceptionGen

This class represents an exception handler, i.e., specifies the region where a handler is active and an instruction where the actual handling is done.

public class
ConstantPoolGen

This class is used to build up a constant pool.

public abstract class
ConversionInstruction

Super class for the x2y family of instructions.

public abstract class
CPInstruction

Abstract super class for instructions that use an index into the constant pool such as LDC, INVOKEVIRTUAL, etc.

public class
D2F

D2F - Convert double to float

Stack: ..., value.word1, value.word2 -> ..., result
public class
D2I

D2I - Convert double to int

Stack: ..., value.word1, value.word2 -> ..., result
public class
D2L

D2L - Convert double to long

Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2
public class
DADD

DADD - Add doubles

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
DALOAD

DALOAD - Load double from array

Stack: ..., arrayref, index -> ..., result.word1, result.word2
public class
DASTORE

DASTORE - Store into double array

Stack: ..., arrayref, index, value.word1, value.word2 -> ...
public class
DCMPG

DCMPG - Compare doubles: value1 > value2

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -> ..., result
public class
DCMPL

DCMPL - Compare doubles: value1 < value2

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -> ..., result
public class
DCONST

DCONST - Push 0.0 or 1.0, other values cause an exception

Stack: ...
public class
DDIV

DDIV - Divide doubles

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
DLOAD

DLOAD - Load double from local variable

Stack ...
public class
DMUL

DMUL - Multiply doubles

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
DNEG

DNEG - Negate double

Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2
public class
DREM

DREM - Remainder of doubles

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
DRETURN

DRETURN - Return double from method

Stack: ..., value.word1, value.word2 -> <empty>
public class
DSTORE

DSTORE - Store double into local variable

Stack: ..., value.word1, value.word2 -> ...
public class
DSUB

DSUB - Substract doubles

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
DUP

DUP - Duplicate top operand stack word

Stack: ..., word -> ..., word, word
public class
DUP2

DUP2 - Duplicate two top operand stack words

Stack: ..., word2, word1 -> ..., word2, word1, word2, word1
public class
DUP2_X1

DUP2_X1 - Duplicate two top operand stack words and put three down

Stack: ..., word3, word2, word1 -> ..., word2, word1, word3, word2, word1
public class
DUP2_X2

DUP2_X2 - Duplicate two top operand stack words and put four down

Stack: ..., word4, word3, word2, word1 -> ..., word2, word1, word4, word3, word2, word1
public class
DUP_X1

DUP_X1 - Duplicate top operand stack word and put two down

Stack: ..., word2, word1 -> ..., word1, word2, word1
public class
DUP_X2

DUP_X2 - Duplicate top operand stack word and put three down

Stack: ..., word3, word2, word1 -> ..., word1, word3, word2, word1
public abstract class
public class
public abstract class
EmptyVisitor

Supplies empty method bodies to be overridden by subclasses.

public class
public class
F2D

F2D - Convert float to double

Stack: ..., value -> ..., result.word1, result.word2
public class
F2I

F2I - Convert float to int

Stack: ..., value -> ..., result
public class
F2L

F2L - Convert float to long

Stack: ..., value -> ..., result.word1, result.word2
public class
FADD

FADD - Add floats

Stack: ..., value1, value2 -> result
public class
FALOAD

FALOAD - Load float from array

Stack: ..., arrayref, index -> ..., value
public class
FASTORE

FASTORE - Store into float array

Stack: ..., arrayref, index, value -> ...
public class
FCMPG

FCMPG - Compare floats: value1 > value2

Stack: ..., value1, value2 -> ..., result
public class
FCMPL

FCMPL - Compare floats: value1 < value2

Stack: ..., value1, value2 -> ..., result
public class
FCONST

FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception

Stack: ...
public class
FDIV

FDIV - Divide floats

Stack: ..., value1, value2 -> result
public class
FieldGen

Template class for building up a field.

public abstract class
FieldGenOrMethodGen

Super class for FieldGen and MethodGen objects, since they have some methods in common!

public abstract class
FieldInstruction

Super class for the GET/PUTxxx family of instructions.

public abstract class
FieldOrMethod

Super class for InvokeInstruction and FieldInstruction, since they have some methods in common!

public class
FLOAD

FLOAD - Load float from local variable

Stack ...
public class
FMUL

FMUL - Multiply floats

Stack: ..., value1, value2 -> result
public class
FNEG

FNEG - Negate float

Stack: ..., value -> ..., result
public class
FREM

FREM - Remainder of floats

Stack: ..., value1, value2 -> result
public class
FRETURN

FRETURN - Return float from method

Stack: ..., value -> <empty>
public class
FSTORE

FSTORE - Store float into local variable

Stack: ..., value -> ...
public class
FSUB

FSUB - Substract floats

Stack: ..., value1, value2 -> result
public class
GETFIELD

GETFIELD - Fetch field from object

Stack: ..., objectref -> ..., value
public class
GETSTATIC

GETSTATIC - Fetch static field from class

Stack: ..., -> ..., value
public class
GOTO

GOTO - Branch always (to relative offset, not absolute address)

public class
GOTO_W

GOTO_W - Branch always (to relative offset, not absolute address)

public abstract class
GotoInstruction

Super class for GOTO

public class
I2B

I2B - Convert int to byte

Stack: ..., value -> ..., result
public class
I2C

I2C - Convert int to char

Stack: ..., value -> ..., result
public class
I2D

I2D - Convert int to double

Stack: ..., value -> ..., result.word1, result.word2
public class
I2F

I2F - Convert int to float

Stack: ..., value -> ..., result
public class
I2L

I2L - Convert int to long

Stack: ..., value -> ..., result.word1, result.word2
public class
I2S

I2S - Convert int to short

Stack: ..., value -> ..., result
public class
IADD

IADD - Add ints

Stack: ..., value1, value2 -> result
public class
IALOAD

IALOAD - Load int from array

Stack: ..., arrayref, index -> ..., value
public class
IAND

IAND - Bitwise AND int

Stack: ..., value1, value2 -> ..., result
public class
IASTORE

IASTORE - Store into int array

Stack: ..., arrayref, index, value -> ...
public class
ICONST

ICONST - Push value between -1, ..., 5, other values cause an exception

Stack: ...
public class
IDIV

IDIV - Divide ints

Stack: ..., value1, value2 -> result
public class
IF_ACMPEQ

IF_ACMPEQ - Branch if reference comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ACMPNE

IF_ACMPNE - Branch if reference comparison doesn't succeed

Stack: ..., value1, value2 -> ...
public class
IF_ICMPEQ

IF_ICMPEQ - Branch if int comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ICMPGE

IF_ICMPGE - Branch if int comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ICMPGT

IF_ICMPGT - Branch if int comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ICMPLE

IF_ICMPLE - Branch if int comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ICMPLT

IF_ICMPLT - Branch if int comparison succeeds

Stack: ..., value1, value2 -> ...
public class
IF_ICMPNE

IF_ICMPNE - Branch if int comparison doesn't succeed

Stack: ..., value1, value2 -> ...
public class
IFEQ

IFEQ - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public class
IFGE

IFGE - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public class
IFGT

IFGT - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public abstract class
IfInstruction

Super class for the IFxxx family of instructions.

public class
IFLE

IFLE - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public class
IFLT

IFLT - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public class
IFNE

IFNE - Branch if int comparison with zero succeeds

Stack: ..., value -> ...
public class
IFNONNULL

IFNONNULL - Branch if reference is not null

Stack: ..., reference -> ...
public class
IFNULL

IFNULL - Branch if reference is not null

Stack: ..., reference -> ...
public class
IINC

IINC - Increment local variable by constant

public class
ILOAD

ILOAD - Load int from local variable onto stack

Stack: ...
public class
IMPDEP1

IMPDEP1 - Implementation dependent

public class
IMPDEP2

IMPDEP2 - Implementation dependent

public class
IMUL

IMUL - Multiply ints

Stack: ..., value1, value2 -> result
public class
INEG

INEG - Negate int

Stack: ..., value -> ..., result
public class
INSTANCEOF

INSTANCEOF - Determine if object is of given type

Stack: ..., objectref -> ..., result
public abstract class
Instruction

Abstract super class for all Java byte codes.

public class
InstructionConst

Contains shareable instruction objects.

public class
InstructionFactory

Deprecated as a consequence of InstructionConstants being deprecated.
Instances of this class may be used, e.g., to generate typed versions of instructions.
public class
InstructionHandle

Instances of this class give users a handle to the instructions contained in an InstructionList.

public class
InstructionList

This class is a container for a list of Instruction objects.

public class
INVOKEDYNAMIC

Class for INVOKEDYNAMIC.

public abstract class
InvokeInstruction

Super class for the INVOKExxx family of instructions.

public class
INVOKEINTERFACE

INVOKEINTERFACE - Invoke interface method

Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
public class
INVOKESPECIAL

INVOKESPECIAL - Invoke instance method; special handling for superclass, private and instance initialization method invocations

Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
public class
INVOKESTATIC

INVOKESTATIC - Invoke a class (static) method

Stack: ..., [arg1, [arg2 ...]] -> ...
public class
INVOKEVIRTUAL

INVOKEVIRTUAL - Invoke instance method; dispatch based on class

Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
public class
IOR

IOR - Bitwise OR int

Stack: ..., value1, value2 -> ..., result
public class
IREM

IREM - Remainder of int

Stack: ..., value1, value2 -> result
public class
IRETURN

IRETURN - Return int from method

Stack: ..., value -> <empty>
public class
ISHL

ISHL - Arithmetic shift left int

Stack: ..., value1, value2 -> ..., result
public class
ISHR

ISHR - Arithmetic shift right int

Stack: ..., value1, value2 -> ..., result
public class
ISTORE

ISTORE - Store int from stack into local variable

Stack: ..., value -> ...
public class
ISUB

ISUB - Substract ints

Stack: ..., value1, value2 -> result
public class
IUSHR

IUSHR - Logical shift right int

Stack: ..., value1, value2 -> ..., result
public class
IXOR

IXOR - Bitwise XOR int

Stack: ..., value1, value2 -> ..., result
public class
JSR

JSR - Jump to subroutine

public class
JSR_W

JSR_W - Jump to subroutine

public abstract class
JsrInstruction

Super class for JSR - Jump to subroutine

public class
L2D

L2D - Convert long to double

Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2
public class
L2F

L2F - Convert long to float

Stack: ..., value.word1, value.word2 -> ..., result
public class
L2I

L2I - Convert long to int

Stack: ..., value.word1, value.word2 -> ..., result
public class
LADD

LADD - Add longs

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
LALOAD

LALOAD - Load long from array

Stack: ..., arrayref, index -> ..., value1, value2
public class
LAND

LAND - Bitwise AND longs

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
LASTORE

LASTORE - Store into long array

Stack: ..., arrayref, index, value.word1, value.word2 -> ...
public class
LCMP

LCMP - Compare longs:

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -> ..., result <= -1, 0, 1>
public class
LCONST

LCONST - Push 0 or 1, other values cause an exception

Stack: ...
public class
LDC

LDC - Push item from constant pool.

public class
LDC2_W

LDC2_W - Push long or double from constant pool

Stack: ...
public class
LDC_W

LDC_W - Push item from constant pool (wide index)

Stack: ...
public class
LDIV

LDIV - Divide longs

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
LineNumberGen

This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.

public class
LLOAD

LLOAD - Load long from local variable

Stack ...
public class
LMUL

LMUL - Multiply longs

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
LNEG

LNEG - Negate long

Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2
public abstract class
LoadInstruction

Denotes an unparameterized instruction to load a value from a local variable, e.g. ILOAD.

public class
LocalVariableGen

Represents a local variable within a method.

public abstract class
LocalVariableInstruction

Abstract super class for instructions dealing with local variables.

public class
LOOKUPSWITCH

LOOKUPSWITCH - Switch with unordered set of values

public class
LOR

LOR - Bitwise OR long

Stack: ..., value1, value2 -> ..., result
public class
LREM

LREM - Remainder of long

Stack: ..., value1, value2 -> result
public class
LRETURN

LRETURN - Return long from method

Stack: ..., value.word1, value.word2 -> <empty>
public class
LSHL

LSHL - Arithmetic shift left long

Stack: ..., value1.word1, value1.word2, value2 -> ..., result.word1, result.word2
public class
LSHR

LSHR - Arithmetic shift right long

Stack: ..., value1.word1, value1.word2, value2 -> ..., result.word1, result.word2
public class
LSTORE

LSTORE - Store long into local variable

Stack: ..., value.word1, value.word2 -> ...
public class
LSUB

LSUB - Substract longs

Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 ->
public class
LUSHR

LUSHR - Logical shift right long

Stack: ..., value1, value2 -> ..., result
public class
LXOR

LXOR - Bitwise XOR long

Stack: ..., value1, value2 -> ..., result
public class
MethodGen

Template class for building up a method.

public class
MONITORENTER

MONITORENTER - Enter monitor for object

Stack: ..., objectref -> ...
public class
MONITOREXIT

MONITOREXIT - Exit monitor for object

Stack: ..., objectref -> ...
public class
MULTIANEWARRAY

MULTIANEWARRAY - Create new mutidimensional array of references

Stack: ..., count1, [count2, ...] -> ..., arrayref
public abstract class
NameSignatureInstruction

Super class for FieldOrMethod and INVOKEDYNAMIC, since they both have names and signatures

public class
NEW

NEW - Create new object

Stack: ...
public class
NEWARRAY

NEWARRAY - Create new array of basic type (int, short, ...)

Stack: ..., count -> ..., arrayref
public class
NOP

NOP - Do nothing

public class
ObjectType

Denotes reference such as String.

public class
POP

POP - Pop top operand stack word

Stack: ..., word -> ...
public class
POP2

POP2 - Pop two top operand stack words

Stack: ..., word2, word1 -> ...
public class
PUSH

Deprecated as a consequence of InstructionConstants being deprecated.
Wrapper class for push operations, which are implemented either as BIPUSH, LDC or xCONST_n instructions.
public class
PUTFIELD

PUTFIELD - Put field in object

Stack: ..., objectref, value -> ...
public class
PUTSTATIC

PUTSTATIC - Put static field in class

Stack: ..., value -> ...
public abstract class
ReferenceType

Super class for object and array types.

public class
RET

RET - Return from subroutine

Stack: ...
public class
RETURN

RETURN - Return from void method

Stack: ...
public class
ReturnaddressType

Returnaddress, the type JSR or JSR_W instructions push upon the stack.

public abstract class
ReturnInstruction

Super class for the xRETURN family of instructions.

public class
SALOAD

SALOAD - Load short from array

Stack: ..., arrayref, index -> ..., value
public class
SASTORE

SASTORE - Store into short array

Stack: ..., arrayref, index, value -> ...
public abstract class
Select

Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.

public class
public class
SIPUSH

SIPUSH - Push short

Stack: ...
public abstract class
StackInstruction

Super class for stack operations like DUP and POP.

public abstract class
StoreInstruction

Denotes an unparameterized instruction to store a value into a local variable, e.g. ISTORE.

public class
SWAP

SWAP - Swa top operand stack word

Stack: ..., word2, word1 -> ..., word1, word2
public class
SWITCH

SWITCH - Branch depending on int value, generates either LOOKUPSWITCH or TABLESWITCH instruction, depending on whether the match values (int[]) can be sorted with no gaps between the numbers.

public class
TABLESWITCH

TABLESWITCH - Switch within given range of values, i.e., low..high

public class
TargetLostException

Thrown by InstructionList.remove() when one or multiple disposed instructions are still being referenced by an InstructionTargeter object.

public abstract class
Type

Abstract super class for all possible Java types, namely basic types such as int, object types like String and array types, e.g. int[]