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

Packages that use Type
Package
Description
org.apache.bcel.classfile
Classes that describe the structure of a Java class file and a class file parser.
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.statics
PassVerifier classes used internally by JustIce.
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 Type in org.apache.bcel.classfile

  Methods in org.apache.bcel.classfile that return Type
  Modifier and Type
  Method
  Description
  `Type[]`
  Method.`getArgumentTypes()`
  Gets array of method argument types.
  `Type`
  Method.`getReturnType()`
  Gets return type of method.
  `Type`
  Field.`getType()`
  See https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.2.2
  Methods in org.apache.bcel.classfile with parameters of type Type
  Modifier and Type
  Method
  Description
  `Field`
  JavaClass.`findField(String fieldName, Type fieldType)`
  Finds a visible field by name and type in this class and its super classes.

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

  Subclasses of Type in org.apache.bcel.generic
  Modifier and Type
  Class
  Description
  `final class`
  `ArrayType`
  Denotes array type, such as int[][]
  `final class`
  `BasicType`
  Denotes basic type such as int.
  `class`
  `ObjectType`
  Denotes reference such as `String`.
  `class`
  `ReferenceType`
  Super class for object and array types.
  `class`
  `ReturnaddressType`
  Returnaddress, the type JSR or JSR_W instructions push upon the stack.
  Fields in org.apache.bcel.generic declared as Type
  Modifier and Type
  Field
  Description
  `static final Type[]`
  Type.`NO_ARGS`
  Empty array.
  `protected Type`
  FieldGenOrMethodGen.`type`
  Deprecated.
  (since 6.0) will be made private; do not access directly, use getter/setter
  `static final Type`
  Type.`UNKNOWN`
  Methods in org.apache.bcel.generic that return Type
  Modifier and Type
  Method
  Description
  `Type`
  MethodGen.`getArgumentType(int i)`
  Gets the argument type at the specified index.
  `Type[]`
  InvokeInstruction.`getArgumentTypes(ConstantPoolGen cpg)`
  Gets the argument types of referenced method.
  `Type[]`
  MethodGen.`getArgumentTypes()`
  Gets all argument types.
  `static Type[]`
  Type.`getArgumentTypes(String signature)`
  Convert arguments of a method (signature) to an array of Type objects.
  `Type`
  ArrayType.`getBasicType()`
  Gets the basic type of array, that is, for int[][][] the basic type is int.
  `Type`
  ArrayType.`getElementType()`
  Gets the element type of array, that is, for int[][][] the element type is int[][].
  `Type`
  FieldInstruction.`getFieldType(ConstantPoolGen cpg)`
  Gets the type of field.
  `Type`
  InvokeInstruction.`getReturnType(ConstantPoolGen cpg)`
  Gets the return type of referenced method.
  `Type`
  MethodGen.`getReturnType()`
  Gets the return type.
  `static Type`
  Type.`getReturnType(String signature)`
  Convert return value of a method (signature) to a Type object.
  `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`
  FieldGenOrMethodGen.`getType()`
  `Type`
  FieldInstruction.`getType(ConstantPoolGen cpg)`
  `Type`
  ICONST.`getType(ConstantPoolGen cp)`
  `Type`
  IINC.`getType(ConstantPoolGen cp)`
  Gets the int type.
  `Type`
  InvokeInstruction.`getType(ConstantPoolGen cpg)`
  Gets the return type of referenced method.
  `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`
  LocalVariableGen.`getType()`
  `Type`
  LocalVariableInstruction.`getType(ConstantPoolGen cp)`
  Returns the type associated with the instruction - in case of ALOAD or ASTORE Type.OBJECT is returned.
  `Type`
  NamedAndTyped.`getType()`
  Gets the type.
  `final Type`
  NEWARRAY.`getType()`
  `Type`
  RET.`getType(ConstantPoolGen cp)`
  `Type`
  ReturnInstruction.`getType()`
  `Type`
  ReturnInstruction.`getType(ConstantPoolGen cp)`
  `Type`
  SIPUSH.`getType(ConstantPoolGen cp)`
  `Type`
  StackInstruction.`getType(ConstantPoolGen cp)`
  Gets the type.
  `static Type`
  Type.`getType(Class<?> cls)`
  Convert runtime `Class` to BCEL Type object.
  `static Type`
  Type.`getType(String signature)`
  Convert signature to a Type object.
  `Type`
  TypedInstruction.`getType(ConstantPoolGen cpg)`
  Gets the type associated with this instruction.
  `static Type[]`
  Type.`getTypes(Class<?>[] classes)`
  Convert runtime `java.lang.Class[]` to BCEL Type objects.
  `Type`
  Type.`normalizeForStackOrLocal()`
  boolean, short and char variable are considered as int in the stack or local variable area.
  Methods in org.apache.bcel.generic with parameters of type Type
  Modifier and Type
  Method
  Description
  `LocalVariableGen`
  MethodGen.`addLocalVariable(String name, Type type, int slot, InstructionHandle start, InstructionHandle end)`
  Adds a local variable to this method.
  `LocalVariableGen`
  MethodGen.`addLocalVariable(String name, Type type, int slot, InstructionHandle start, InstructionHandle end, int origIndex)`
  Adds a local variable to this method.
  `LocalVariableGen`
  MethodGen.`addLocalVariable(String name, Type type, InstructionHandle start, InstructionHandle end)`
  Adds a local variable to this method and assigns an index automatically.
  `Instruction`
  InstructionFactory.`createAppend(Type type)`
  Creates an append instruction for the given type.
  `static ArrayInstruction`
  InstructionFactory.`createArrayLoad(Type type)`
  Creates an array load instruction for the given type.
  `static ArrayInstruction`
  InstructionFactory.`createArrayStore(Type type)`
  Creates an array store instruction for the given type.
  `static ArithmeticInstruction`
  InstructionFactory.`createBinaryOperation(String op, Type type)`
  Create binary operation for simple basic types, such as int and float.
  `Instruction`
  InstructionFactory.`createCast(Type srcType, Type destType)`
  Create conversion operation for two stack operands, this may be an I2C, instruction, for example, if the operands are basic types and CHECKCAST if they are reference types.
  `FieldInstruction`
  InstructionFactory.`createFieldAccess(String className, String name, Type type, short kind)`
  Create a field instruction.
  `GETFIELD`
  InstructionFactory.`createGetField(String className, String name, Type t)`
  Creates a GETFIELD instruction.
  `GETSTATIC`
  InstructionFactory.`createGetStatic(String className, String name, Type t)`
  Creates a GETSTATIC instruction.
  `InvokeInstruction`
  InstructionFactory.`createInvoke(String className, String name, Type retType, Type[] argTypes, short kind)`
  Create an invoke instruction.
  `InvokeInstruction`
  InstructionFactory.`createInvoke(String className, String name, Type retType, Type[] argTypes, short kind, boolean useInterface)`
  Create an invoke instruction.
  `static LocalVariableInstruction`
  InstructionFactory.`createLoad(Type type, int index)`
  Creates a load instruction for the given type.
  `Instruction`
  InstructionFactory.`createNewArray(Type t, short dim)`
  Create new array of given size and type.
  `static Instruction`
  InstructionFactory.`createNull(Type type)`
  Create "null" value for reference types, 0 for basic types like int.
  `PUTFIELD`
  InstructionFactory.`createPutField(String className, String name, Type t)`
  Creates a PUTFIELD instruction.
  `PUTSTATIC`
  InstructionFactory.`createPutStatic(String className, String name, Type t)`
  Creates a PUTSTATIC instruction.
  `static ReturnInstruction`
  InstructionFactory.`createReturn(Type type)`
  Create typed return.
  `static LocalVariableInstruction`
  InstructionFactory.`createStore(Type type, int index)`
  Creates a store instruction.
  `static String`
  Type.`getMethodSignature(Type returnType, Type[] argTypes)`
  Convert type to Java method signature, for example int[] f(java.lang.String x) becomes (Ljava/lang/String;)[I
  `boolean`
  ReferenceType.`isAssignmentCompatibleWith(Type t)`
  Return true iff this is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there.
  `boolean`
  ReferenceType.`isCastableTo(Type t)`
  Return true iff this type is castable to another type t as defined in the JVM specification.
  `void`
  MethodGen.`setArgumentType(int i, Type type)`
  Sets the argument type at the specified index.
  `void`
  MethodGen.`setArgumentTypes(Type[] argTypes)`
  Sets all argument types.
  `void`
  MethodGen.`setReturnType(Type returnType)`
  Sets the return type.
  `void`
  FieldGenOrMethodGen.`setType(Type type)`
  `void`
  LocalVariableGen.`setType(Type type)`
  `void`
  NamedAndTyped.`setType(Type type)`
  Sets the type.
  Constructors in org.apache.bcel.generic with parameters of type Type
  Modifier
  Constructor
  Description
  ``
  `ArrayType(Type type, int dimensions)`
  Constructor for array of given type
  ``
  `FieldGen(int accessFlags, Type type, String name, ConstantPoolGen cp)`
  Declare a field.
  ``
  `LocalVariableGen(int index, String name, Type type, InstructionHandle start, InstructionHandle end)`
  Generate a local variable that with index 'index'.
  ``
  `LocalVariableGen(int index, String name, Type type, InstructionHandle start, InstructionHandle end, int origIndex)`
  Generates a local variable that with index 'index'.
  ``
  `MethodGen(int accessFlags, Type returnType, Type[] argTypes, String[] argNames, String methodName, String className, InstructionList il, ConstantPoolGen cp)`
  Declare method.

- ## Uses of Type in org.apache.bcel.verifier.statics

  Subclasses of Type in org.apache.bcel.verifier.statics
  Modifier and Type
  Class
  Description
  `final class`
  `DOUBLE_Upper`
  This class represents the upper half of a DOUBLE variable.
  `final class`
  `LONG_Upper`
  This class represents the upper half of a LONG variable.
  Methods in org.apache.bcel.verifier.statics that return Type
  Modifier and Type
  Method
  Description
  `Type`
  LocalVariableInfo.`getType(int offset)`
  Returns the type of the local variable that uses this local variable slot at the given bytecode offset.
  Methods in org.apache.bcel.verifier.statics with parameters of type Type
  Modifier and Type
  Method
  Description
  `void`
  LocalVariableInfo.`add(String name, int startPc, int length, Type type)`
  Adds some information about this local variable (slot).
  `void`
  LocalVariablesInfo.`add(int slot, String name, int startPc, int length, Type type)`
  Adds information about the local variable in slot 'slot'.

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

  Subclasses of Type in org.apache.bcel.verifier.structurals
  Modifier and Type
  Class
  Description
  `class`
  `UninitializedObjectType`
  This class represents an uninitialized object type; see The Java Virtual Machine Specification, Second Edition, page 147: 4.9.4 for more details.
  Methods in org.apache.bcel.verifier.structurals that return Type
  Modifier and Type
  Method
  Description
  `Type`
  LocalVariables.`get(int slotIndex)`
  Returns the type of the local variable slot index.
  `Type`
  OperandStack.`peek()`
  Returns the element on top of the stack.
  `Type`
  OperandStack.`peek(int i)`
  Returns the element that's i elements below the top element; that means, iff i==0 the top element is returned.
  `Type`
  OperandStack.`pop()`
  Returns the element on top of the stack.
  `Type`
  OperandStack.`pop(int count)`
  Pops i elements off the stack.
  Methods in org.apache.bcel.verifier.structurals with parameters of type Type
  Modifier and Type
  Method
  Description
  `void`
  Pass3bVerifier.`invalidReturnTypeError(Type returnedType, MethodGen m)`
  Throws an exception indicating the returned type is not compatible with the return type of the given method.
  `void`
  OperandStack.`push(Type type)`
  Pushes a Type object onto the stack.
  `void`
  LocalVariables.`set(int slotIndex, Type type)`
  Sets a new Type for the given local variable slot.