# Package org.apache.bcel.generic

This package contains the "generic" part of the Byte Code Engineering Library, i.e., classes to dynamically modify class objects and byte code instructions.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  AllocationInstruction | Denote family of instructions that allocates space in the heap.
  ClassObserver | Implement this interface if you're interested in changes to a ClassGen object and register yourself with addObserver().
  CompoundInstruction | Wrapper class for `compound' operations, virtual instructions that don't exist as byte code, but give a useful meaning.
  ConstantPushInstruction | Denotes a push instruction that produces a literal on the stack such as SIPUSH, BIPUSH, ICONST, etc.
  ExceptionThrower | Denote an instruction that may throw a run-time or a linking exception (or both) during execution.
  FieldObserver | Imnplement this interface if you're interested in changes to a FieldGen object and register yourself with addObserver().
  IndexedInstruction | Denote entity that refers to an index, e.g.
  InstructionComparator | Equality of instructions isn't clearly to be defined.
  InstructionConstants | Deprecated (since 6.0) Do not use.
  InstructionListObserver | Implement this interface if you're interested in changes to an InstructionList object and register yourself with addObserver().
  InstructionTargeter | Denote that a class targets InstructionHandles within an InstructionList.
  LoadClass | Denotes that an instruction may start the process of loading and resolving the referenced class in the Virtual Machine.
  MethodObserver | Implement this interface if you're interested in changes to a MethodGen object and register yourself with addObserver().
  NamedAndTyped | Denote entity that has both name and type.
  PopInstruction | Denotes an unparameterized instruction to pop a value on top from the stack, such as ISTORE, POP, PUTSTATIC.
  PushInstruction | Denotes an unparameterized instruction to produce a value on top of the stack, such as ILOAD, LDC, SIPUSH, DUP, ICONST, etc.
  StackConsumer | Denote an instruction that may consume a value from the stack.
  StackProducer | Denote an instruction that may produce a value on top of the stack (this excludes DUP_X1, e.g.)
  TypedInstruction | Get the type associated with an instruction, int for ILOAD, or the type of the field of a PUTFIELD instruction, e.g..
  UnconditionalBranch | Denotes an instruction to perform an unconditional branch, i.e., GOTO, JSR.
  VariableLengthInstruction | Denotes an instruction to be a variable length instruction, such as GOTO, JSR, LOOKUPSWITCH and TABLESWITCH.
  Visitor | Interface implementing the Visitor pattern programming style.

- Class Summary
  Class | Description
  --- | ---
  AALOAD | AALOAD - Load reference from array
  AASTORE | AASTORE - Store into reference array
  ACONST_NULL | ACONST_NULL - Push null reference
  ALOAD | ALOAD - Load reference from local variable
  ANEWARRAY | ANEWARRAY - Create new array of references
  AnnotationElementValueGen |
  AnnotationEntryGen |
  ARETURN | ARETURN - Return reference from method
  ArithmeticInstruction | Super class for the family of arithmetic instructions.
  ArrayElementValueGen |
  ArrayInstruction | Super class for instructions dealing with array access such as IALOAD.
  ARRAYLENGTH | ARRAYLENGTH - Get length of array
  ArrayType | Denotes array type, such as int[][]
  ASTORE | ASTORE - Store reference into local variable
  ATHROW | ATHROW - Throw exception
  BALOAD | BALOAD - Load byte or boolean from array
  BasicType | Denotes basic type such as int.
  BASTORE | BASTORE - Store into byte or boolean array
  BIPUSH | BIPUSH - Push byte on stack
  BranchHandle | BranchHandle is returned by specialized InstructionList.append() whenever a BranchInstruction is appended.
  BranchInstruction | Abstract super class for branching instructions like GOTO, IFEQ, etc..
  BREAKPOINT | BREAKPOINT, JVM dependent, ignored by default
  CALOAD | CALOAD - Load char from array
  CASTORE | CASTORE - Store into char array
  CHECKCAST | CHECKCAST - Check whether object is of given type
  ClassElementValueGen |
  ClassGen | Template class for building up a java 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.
  ConstantPoolGen | This class is used to build up a constant pool.
  ConversionInstruction | Super class for the x2y family of instructions.
  CPInstruction | Abstract super class for instructions that use an index into the constant pool such as LDC, INVOKEVIRTUAL, etc.
  D2F | D2F - Convert double to float
  D2I | D2I - Convert double to int
  D2L | D2L - Convert double to long
  DADD | DADD - Add doubles
  DALOAD | DALOAD - Load double from array
  DASTORE | DASTORE - Store into double array
  DCMPG | DCMPG - Compare doubles: value1 > value2
  DCMPL | DCMPL - Compare doubles: value1 < value2
  DCONST | DCONST - Push 0.0 or 1.0, other values cause an exception
  DDIV | DDIV - Divide doubles
  DLOAD | DLOAD - Load double from local variable
  DMUL | DMUL - Multiply doubles
  DNEG | DNEG - Negate double
  DREM | DREM - Remainder of doubles
  DRETURN | DRETURN - Return double from method
  DSTORE | DSTORE - Store double into local variable
  DSUB | DSUB - Substract doubles
  DUP | DUP - Duplicate top operand stack word
  DUP_X1 | DUP_X1 - Duplicate top operand stack word and put two down
  DUP_X2 | DUP_X2 - Duplicate top operand stack word and put three down
  DUP2 | DUP2 - Duplicate two top operand stack words
  DUP2_X1 | DUP2_X1 - Duplicate two top operand stack words and put three down
  DUP2_X2 | DUP2_X2 - Duplicate two top operand stack words and put four down
  ElementValueGen |
  ElementValuePairGen |
  EmptyVisitor | Supplies empty method bodies to be overridden by subclasses.
  EnumElementValueGen |
  F2D | F2D - Convert float to double
  F2I | F2I - Convert float to int
  F2L | F2L - Convert float to long
  FADD | FADD - Add floats
  FALOAD | FALOAD - Load float from array
  FASTORE | FASTORE - Store into float array
  FCMPG | FCMPG - Compare floats: value1 > value2
  FCMPL | FCMPL - Compare floats: value1 < value2
  FCONST | FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
  FDIV | FDIV - Divide floats
  FieldGen | Template class for building up a field.
  FieldGenOrMethodGen | Super class for FieldGen and MethodGen objects, since they have some methods in common!
  FieldInstruction | Super class for the GET/PUTxxx family of instructions.
  FieldOrMethod | Super class for InvokeInstruction and FieldInstruction, since they have some methods in common!
  FLOAD | FLOAD - Load float from local variable
  FMUL | FMUL - Multiply floats
  FNEG | FNEG - Negate float
  FREM | FREM - Remainder of floats
  FRETURN | FRETURN - Return float from method
  FSTORE | FSTORE - Store float into local variable
  FSUB | FSUB - Substract floats
  GETFIELD | GETFIELD - Fetch field from object
  GETSTATIC | GETSTATIC - Fetch static field from class
  GOTO | GOTO - Branch always (to relative offset, not absolute address)
  GOTO_W | GOTO_W - Branch always (to relative offset, not absolute address)
  GotoInstruction | Super class for GOTO
  I2B | I2B - Convert int to byte
  I2C | I2C - Convert int to char
  I2D | I2D - Convert int to double
  I2F | I2F - Convert int to float
  I2L | I2L - Convert int to long
  I2S | I2S - Convert int to short
  IADD | IADD - Add ints
  IALOAD | IALOAD - Load int from array
  IAND | IAND - Bitwise AND int
  IASTORE | IASTORE - Store into int array
  ICONST | ICONST - Push value between -1, ..., 5, other values cause an exception
  IDIV | IDIV - Divide ints
  IF_ACMPEQ | IF_ACMPEQ - Branch if reference comparison succeeds
  IF_ACMPNE | IF_ACMPNE - Branch if reference comparison doesn't succeed
  IF_ICMPEQ | IF_ICMPEQ - Branch if int comparison succeeds
  IF_ICMPGE | IF_ICMPGE - Branch if int comparison succeeds
  IF_ICMPGT | IF_ICMPGT - Branch if int comparison succeeds
  IF_ICMPLE | IF_ICMPLE - Branch if int comparison succeeds
  IF_ICMPLT | IF_ICMPLT - Branch if int comparison succeeds
  IF_ICMPNE | IF_ICMPNE - Branch if int comparison doesn't succeed
  IFEQ | IFEQ - Branch if int comparison with zero succeeds
  IFGE | IFGE - Branch if int comparison with zero succeeds
  IFGT | IFGT - Branch if int comparison with zero succeeds
  IfInstruction | Super class for the IFxxx family of instructions.
  IFLE | IFLE - Branch if int comparison with zero succeeds
  IFLT | IFLT - Branch if int comparison with zero succeeds
  IFNE | IFNE - Branch if int comparison with zero succeeds
  IFNONNULL | IFNONNULL - Branch if reference is not null
  IFNULL | IFNULL - Branch if reference is not null
  IINC | IINC - Increment local variable by constant
  ILOAD | ILOAD - Load int from local variable onto stack
  IMPDEP1 | IMPDEP1 - Implementation dependent
  IMPDEP2 | IMPDEP2 - Implementation dependent
  IMUL | IMUL - Multiply ints
  INEG | INEG - Negate int
  INSTANCEOF | INSTANCEOF - Determine if object is of given type
  Instruction | Abstract super class for all Java byte codes.
  InstructionConst | This interface contains shareable instruction objects.
  InstructionConstants.Clinit |
  InstructionFactory | Instances of this class may be used, e.g., to generate typed versions of instructions.
  InstructionHandle | Instances of this class give users a handle to the instructions contained in an InstructionList.
  InstructionList | This class is a container for a list of Instruction objects.
  INVOKEDYNAMIC | Class for INVOKEDYNAMIC.
  InvokeInstruction | Super class for the INVOKExxx family of instructions.
  INVOKEINTERFACE | INVOKEINTERFACE - Invoke interface method
  INVOKESPECIAL | INVOKESPECIAL - Invoke instance method; special handling for superclass, private and instance initialization method invocations
  INVOKESTATIC | INVOKESTATIC - Invoke a class (static) method
  INVOKEVIRTUAL | INVOKEVIRTUAL - Invoke instance method; dispatch based on class
  IOR | IOR - Bitwise OR int
  IREM | IREM - Remainder of int
  IRETURN | IRETURN - Return int from method
  ISHL | ISHL - Arithmetic shift left int
  ISHR | ISHR - Arithmetic shift right int
  ISTORE | ISTORE - Store int from stack into local variable
  ISUB | ISUB - Substract ints
  IUSHR | IUSHR - Logical shift right int
  IXOR | IXOR - Bitwise XOR int
  JSR | JSR - Jump to subroutine
  JSR_W | JSR_W - Jump to subroutine
  JsrInstruction | Super class for JSR - Jump to subroutine
  L2D | L2D - Convert long to double
  L2F | L2F - Convert long to float
  L2I | L2I - Convert long to int
  LADD | LADD - Add longs
  LALOAD | LALOAD - Load long from array
  LAND | LAND - Bitwise AND longs
  LASTORE | LASTORE - Store into long array
  LCMP | LCMP - Compare longs:
  LCONST | LCONST - Push 0 or 1, other values cause an exception
  LDC | LDC - Push item from constant pool.
  LDC_W | LDC_W - Push item from constant pool (wide index)
  LDC2_W | LDC2_W - Push long or double from constant pool
  LDIV | LDIV - Divide longs
  LineNumberGen | This class represents a line number within a method, i.e., give an instruction a line number corresponding to the source code line.
  LLOAD | LLOAD - Load long from local variable
  LMUL | LMUL - Multiply longs
  LNEG | LNEG - Negate long
  LoadInstruction | Denotes an unparameterized instruction to load a value from a local variable, e.g.
  LocalVariableGen | Represents a local variable within a method.
  LocalVariableInstruction | Abstract super class for instructions dealing with local variables.
  LOOKUPSWITCH | LOOKUPSWITCH - Switch with unordered set of values
  LOR | LOR - Bitwise OR long
  LREM | LREM - Remainder of long
  LRETURN | LRETURN - Return long from method
  LSHL | LSHL - Arithmetic shift left long
  LSHR | LSHR - Arithmetic shift right long
  LSTORE | LSTORE - Store long into local variable
  LSUB | LSUB - Substract longs
  LUSHR | LUSHR - Logical shift right long
  LXOR | LXOR - Bitwise XOR long
  MethodGen | Template class for building up a method.
  MONITORENTER | MONITORENTER - Enter monitor for object
  MONITOREXIT | MONITOREXIT - Exit monitor for object
  MULTIANEWARRAY | MULTIANEWARRAY - Create new mutidimensional array of references
  NameSignatureInstruction | Super class for FieldOrMethod and INVOKEDYNAMIC, since they both have names and signatures
  NEW | NEW - Create new object
  NEWARRAY | NEWARRAY - Create new array of basic type (int, short, ...)
  NOP | NOP - Do nothing
  ObjectType | Denotes reference such as java.lang.String.
  POP | POP - Pop top operand stack word
  POP2 | POP2 - Pop two top operand stack words
  PUSH | Wrapper class for push operations, which are implemented either as BIPUSH, LDC or xCONST_n instructions.
  PUTFIELD | PUTFIELD - Put field in object
  PUTSTATIC | PUTSTATIC - Put static field in class
  ReferenceType | Super class for object and array types.
  RET | RET - Return from subroutine
  RETURN | RETURN - Return from void method
  ReturnaddressType | Returnaddress, the type JSR or JSR_W instructions push upon the stack.
  ReturnInstruction | Super class for the xRETURN family of instructions.
  SALOAD | SALOAD - Load short from array
  SASTORE | SASTORE - Store into short array
  Select | Select - Abstract super class for LOOKUPSWITCH and TABLESWITCH instructions.
  SimpleElementValueGen |
  SIPUSH | SIPUSH - Push short
  StackInstruction | Super class for stack operations like DUP and POP.
  StoreInstruction | Denotes an unparameterized instruction to store a value into a local variable, e.g.
  SWAP | SWAP - Swa top operand stack word
  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.
  TABLESWITCH | TABLESWITCH - Switch within given range of values, i.e., low..high
  Type | Abstract super class for all possible java types, namely basic types such as int, object types like String and array types, e.g.

- Exception Summary
  Exception | Description
  --- | ---
  ClassGenException | Thrown on internal errors.
  TargetLostException | Thrown by InstructionList.remove() when one or multiple disposed instructions are still being referenced by an InstructionTargeter object.

## Package org.apache.bcel.generic Description

This package contains the "generic" part of the Byte Code Engineering Library, i.e., classes to dynamically modify class objects and byte code instructions.

Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.