# Uses of Class
org.apache.bcel.generic.ConstantPoolGen

Packages that use ConstantPoolGen
Package
Description
org.apache.bcel.generic
Generic part of the Apache Byte Code Engineering Library (BCEL), classes to dynamically modify class objects and byte code instructions.
org.apache.bcel.verifier.structurals
A PassVerifier class mostly used internally by JustIce, yielding a control flow graph for public use as a nice side effect.

- ## Uses of ConstantPoolGen in org.apache.bcel.generic

  Fields in org.apache.bcel.generic declared as ConstantPoolGen
  Modifier and Type
  Field
  Description
  `protected ConstantPoolGen`
  FieldGenOrMethodGen.`cp`
  Deprecated.
  (since 6.0) will be made private; do not access directly, use getter/setter
  `protected ConstantPoolGen`
  InstructionFactory.`cp`
  Deprecated.
  (since 6.0) will be made private; do not access directly, use getter/setter
  `protected ConstantPoolGen`
  ElementValueGen.`cpGen`
  Deprecated.
  (since 6.0) will be made private and final; do not access directly, use getter
  Methods in org.apache.bcel.generic that return ConstantPoolGen
  Modifier and Type
  Method
  Description
  `ConstantPoolGen`
  ClassGen.`getConstantPool()`
  `protected ConstantPoolGen`
  ElementValueGen.`getConstantPool()`
  `ConstantPoolGen`
  FieldGenOrMethodGen.`getConstantPool()`
  `ConstantPoolGen`
  InstructionFactory.`getConstantPool()`
  Methods in org.apache.bcel.generic with parameters of type ConstantPoolGen
  Modifier and Type
  Method
  Description
  `void`
  MethodGen.`addAnnotationsAsAttribute(ConstantPoolGen cp)`
  `int`
  ConstantPoolGen.`addConstant(Constant constant, ConstantPoolGen cpGen)`
  Adds a constant from another ConstantPool and returns the new index.
  `void`
  MethodGen.`addParameterAnnotationsAsAttribute(ConstantPoolGen cp)`
  `int`
  Instruction.`consumeStack(ConstantPoolGen cpg)`
  This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference.
  `int`
  InvokeInstruction.`consumeStack(ConstantPoolGen cpg)`
  Also works for instructions whose stack effect depends on the constant pool entry they reference.
  `int`
  INVOKEINTERFACE.`consumeStack(ConstantPoolGen cpg)`
  `int`
  MULTIANEWARRAY.`consumeStack(ConstantPoolGen cpg)`
  Also works for instructions whose stack effect depends on the constant pool entry they reference.
  `int`
  PUTFIELD.`consumeStack(ConstantPoolGen cpg)`
  `int`
  PUTSTATIC.`consumeStack(ConstantPoolGen cpg)`
  `int`
  StackConsumer.`consumeStack(ConstantPoolGen cpg)`
  `static ElementValueGen`
  ElementValueGen.`copy(ElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  Creates an (modifiable) ElementValueGen copy of an (immutable) ElementValue - constant pool is assumed correct.
  `FieldGen`
  FieldGen.`copy(ConstantPoolGen cp)`
  `MethodGen`
  MethodGen.`copy(String className, ConstantPoolGen cp)`
  `Type[]`
  InvokeInstruction.`getArgumentTypes(ConstantPoolGen cpg)`
  `String`
  FieldOrMethod.`getClassName(ConstantPoolGen cpg)`
  Deprecated.
  If the instruction references an array class, this method will return "java.lang.Object".
  `String`
  INVOKEDYNAMIC.`getClassName(ConstantPoolGen cpg)`
  Override the parent method because our class name is held elsewhere.
  `String`
  InvokeInstruction.`getClassName(ConstantPoolGen cpg)`
  This overrides the deprecated version as we know here that the referenced class may legally be an array.
  `ObjectType`
  FieldOrMethod.`getClassType(ConstantPoolGen cpg)`
  Deprecated.
  If the instruction references an array class, the ObjectType returned will be invalid.
  `CodeException`
  CodeExceptionGen.`getCodeException(ConstantPoolGen cp)`
  Gets CodeException object.
  This relies on that the instruction list has already been dumped to byte code or that the 'setPositions' methods has been called for the instruction list.
  `String`
  FieldInstruction.`getFieldName(ConstantPoolGen cpg)`
  `protected int`
  FieldInstruction.`getFieldSize(ConstantPoolGen cpg)`
  `Type`
  FieldInstruction.`getFieldType(ConstantPoolGen cpg)`
  `LineNumberTable`
  MethodGen.`getLineNumberTable(ConstantPoolGen cp)`
  `ObjectType`
  ANEWARRAY.`getLoadClassType(ConstantPoolGen cpg)`
  `ObjectType`
  CHECKCAST.`getLoadClassType(ConstantPoolGen cpg)`
  `ObjectType`
  FieldOrMethod.`getLoadClassType(ConstantPoolGen cpg)`
  Gets the ObjectType of the method return or field.
  `ObjectType`
  INSTANCEOF.`getLoadClassType(ConstantPoolGen cpg)`
  `ObjectType`
  LoadClass.`getLoadClassType(ConstantPoolGen cpg)`
  Returns the `ObjectType` of the referenced class or interface that may be loaded and resolved.
  `ObjectType`
  MULTIANEWARRAY.`getLoadClassType(ConstantPoolGen cpg)`
  `ObjectType`
  NEW.`getLoadClassType(ConstantPoolGen cpg)`
  `LocalVariable`
  LocalVariableGen.`getLocalVariable(ConstantPoolGen cp)`
  Gets LocalVariable object.
  `LocalVariableTable`
  MethodGen.`getLocalVariableTable(ConstantPoolGen cp)`
  `static int`
  MethodGen.`getMaxStack(ConstantPoolGen cp, InstructionList il, CodeExceptionGen[] et)`
  Computes stack usage of an instruction list by performing control flow analysis.
  `String`
  InvokeInstruction.`getMethodName(ConstantPoolGen cpg)`
  `String`
  FieldOrMethod.`getName(ConstantPoolGen cpg)`
  `String`
  NameSignatureInstruction.`getName(ConstantPoolGen cpg)`
  `ConstantNameAndType`
  NameSignatureInstruction.`getNameAndType(ConstantPoolGen cpg)`
  `ReferenceType`
  FieldOrMethod.`getReferenceType(ConstantPoolGen cpg)`
  Gets the reference type representing the class, interface, or array class referenced by the instruction.
  `ReferenceType`
  INVOKEDYNAMIC.`getReferenceType(ConstantPoolGen cpg)`
  Since InvokeDynamic doesn't refer to a reference type, just return `Object`, as that is the only type we can say for sure the reference will be.
  `Type`
  InvokeInstruction.`getReturnType(ConstantPoolGen cpg)`
  `String`
  FieldOrMethod.`getSignature(ConstantPoolGen cpg)`
  `String`
  NameSignatureInstruction.`getSignature(ConstantPoolGen cpg)`
  `Type`
  ACONST_NULL.`getType(ConstantPoolGen cp)`
  `Type`
  ArithmeticInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  ArrayInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  BIPUSH.`getType(ConstantPoolGen cp)`
  `Type`
  ConversionInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  CPInstruction.`getType(ConstantPoolGen cpg)`
  `Type`
  DCMPG.`getType(ConstantPoolGen cp)`
  `Type`
  DCMPL.`getType(ConstantPoolGen cp)`
  `Type`
  DCONST.`getType(ConstantPoolGen cp)`
  `Type`
  FCMPG.`getType(ConstantPoolGen cp)`
  `Type`
  FCMPL.`getType(ConstantPoolGen cp)`
  `Type`
  FCONST.`getType(ConstantPoolGen cp)`
  `Type`
  FieldInstruction.`getType(ConstantPoolGen cpg)`
  `Type`
  ICONST.`getType(ConstantPoolGen cp)`
  `Type`
  IINC.`getType(ConstantPoolGen cp)`
  `Type`
  InvokeInstruction.`getType(ConstantPoolGen cpg)`
  `Type`
  JsrInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  LCMP.`getType(ConstantPoolGen cp)`
  `Type`
  LCONST.`getType(ConstantPoolGen cp)`
  `Type`
  LDC.`getType(ConstantPoolGen cpg)`
  `Type`
  LDC2_W.`getType(ConstantPoolGen cpg)`
  `Type`
  LoadClass.`getType(ConstantPoolGen cpg)`
  Returns the type associated with this instruction.
  `Type`
  LocalVariableInstruction.`getType(ConstantPoolGen cp)`
  Returns the type associated with the instruction - in case of ALOAD or ASTORE Type.OBJECT is returned.
  `Type`
  RET.`getType(ConstantPoolGen cp)`
  `Type`
  ReturnInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  SIPUSH.`getType(ConstantPoolGen cp)`
  `Type`
  StackInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  TypedInstruction.`getType(ConstantPoolGen cpg)`
  `Object`
  LDC.`getValue(ConstantPoolGen cpg)`
  `Number`
  LDC2_W.`getValue(ConstantPoolGen cpg)`
  `int`
  GETFIELD.`produceStack(ConstantPoolGen cpg)`
  `int`
  GETSTATIC.`produceStack(ConstantPoolGen cpg)`
  `int`
  Instruction.`produceStack(ConstantPoolGen cpg)`
  This method also gives right results for instructions whose effect on the stack depends on the constant pool entry they reference.
  `int`
  InvokeInstruction.`produceStack(ConstantPoolGen cpg)`
  Also works for instructions whose stack effect depends on the constant pool entry they reference.
  `int`
  StackProducer.`produceStack(ConstantPoolGen cpg)`
  `static AnnotationEntryGen`
  AnnotationEntryGen.`read(DataInput dis, ConstantPoolGen cpool, boolean b)`
  `static ElementValueGen`
  ElementValueGen.`readElementValue(DataInput dis, ConstantPoolGen cpGen)`
  `void`
  InstructionList.`replaceConstantPool(ConstantPoolGen oldCp, ConstantPoolGen newCp)`
  Replace all references to the old constant pool with references to the new constant pool
  `void`
  ClassGen.`setConstantPool(ConstantPoolGen constantPool)`
  `void`
  FieldGenOrMethodGen.`setConstantPool(ConstantPoolGen cp)`
  `void`
  InstructionFactory.`setConstantPool(ConstantPoolGen c)`
  Constructors in org.apache.bcel.generic with parameters of type ConstantPoolGen
  Modifier
  Constructor
  Description
  ``
  `AnnotationElementValueGen(int type, AnnotationEntryGen annotation, ConstantPoolGen cpool)`
  ``
  `AnnotationElementValueGen(AnnotationElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  ``
  `AnnotationElementValueGen(AnnotationEntryGen a, ConstantPoolGen cpool)`
  ``
  `AnnotationEntryGen(AnnotationEntry a, ConstantPoolGen cpool, boolean copyPoolEntries)`
  Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object.
  ``
  `AnnotationEntryGen(ObjectType type, List<ElementValuePairGen> elements, boolean vis, ConstantPoolGen cpool)`
  ``
  `ArrayElementValueGen(int type, ElementValue[] elementValues, ConstantPoolGen cpool)`
  ``
  `ArrayElementValueGen(ArrayElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  ``
  `ArrayElementValueGen(ConstantPoolGen cp)`
  `protected`
  `ClassElementValueGen(int typeIdx, ConstantPoolGen cpool)`
  ``
  `ClassElementValueGen(ClassElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  ``
  `ClassElementValueGen(ObjectType t, ConstantPoolGen cpool)`
  ``
  `ClassGen(String className, String superClassName, String fileName, int accessFlags, String[] interfaces, ConstantPoolGen cp)`
  Convenience constructor to set up some important values initially.
  `protected`
  `ElementValueGen(int type, ConstantPoolGen cpGen)`
  `protected`
  `ElementValuePairGen(int idx, ElementValueGen value, ConstantPoolGen cpool)`
  ``
  `ElementValuePairGen(String name, ElementValueGen value, ConstantPoolGen cpool)`
  ``
  `ElementValuePairGen(ElementValuePair nvp, ConstantPoolGen cpool, boolean copyPoolEntries)`
  `protected`
  `EnumElementValueGen(int typeIdx, int valueIdx, ConstantPoolGen cpool)`
  This ctor assumes the constant pool already contains the right type and value - as indicated by typeIdx and valueIdx.
  ``
  `EnumElementValueGen(EnumElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  ``
  `EnumElementValueGen(ObjectType t, String value, ConstantPoolGen cpool)`
  ``
  `FieldGen(int accessFlags, Type type, String name, ConstantPoolGen cp)`
  Declare a field.
  ``
  `FieldGen(Field field, ConstantPoolGen cp)`
  Instantiate from existing field.
  ``
  `InstructionFactory(ClassGen cg, ConstantPoolGen cp)`
  ``
  `InstructionFactory(ConstantPoolGen cp)`
  Initialize just with ConstantPoolGen object
  ``
  `MethodGen(int accessFlags, Type returnType, Type[] argTypes, String[] argNames, String methodName, String className, InstructionList il, ConstantPoolGen cp)`
  Declare method.
  ``
  `MethodGen(Method method, String className, ConstantPoolGen cp)`
  Instantiate from existing method.
  ``
  `PUSH(ConstantPoolGen cp, boolean value)`
  ``
  `PUSH(ConstantPoolGen cp, double value)`
  ``
  `PUSH(ConstantPoolGen cp, float value)`
  ``
  `PUSH(ConstantPoolGen cp, int value)`
  This constructor also applies for values of type short, char, byte
  ``
  `PUSH(ConstantPoolGen cp, long value)`
  ``
  `PUSH(ConstantPoolGen cp, Boolean value)`
  ``
  `PUSH(ConstantPoolGen cp, Character value)`
  creates a push object from a Character value.
  ``
  `PUSH(ConstantPoolGen cp, Number value)`
  ``
  `PUSH(ConstantPoolGen cp, String value)`
  ``
  `PUSH(ConstantPoolGen cp, ArrayType value)`
  Pushes an array type constant, for example `int[].class`, `String[].class`, and so on.
  ``
  `PUSH(ConstantPoolGen cp, ObjectType value)`
  `protected`
  `SimpleElementValueGen(int type, int idx, ConstantPoolGen cpGen)`
  Protected ctor used for deserialization, doesn't *put* an entry in the constant pool, assumes the one at the supplied index is correct.
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, boolean value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, byte value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, char value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, double value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, float value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, int value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, long value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, short value)`
  ``
  `SimpleElementValueGen(int type, ConstantPoolGen cpGen, String value)`
  ``
  `SimpleElementValueGen(SimpleElementValue value, ConstantPoolGen cpool, boolean copyPoolEntries)`
  The boolean controls whether we copy info from the 'old' constant pool to the 'new'.

- ## Uses of ConstantPoolGen in org.apache.bcel.verifier.structurals

  Methods in org.apache.bcel.verifier.structurals with parameters of type ConstantPoolGen
  Modifier and Type
  Method
  Description
  `void`
  ExecutionVisitor.`setConstantPoolGen(ConstantPoolGen cpg)`
  Sets the ConstantPoolGen needed for symbolic execution.
  `void`
  InstConstraintVisitor.`setConstantPoolGen(ConstantPoolGen cpg)`
  Sets the ConstantPoolGen instance needed for constraint checking prior to execution.