Class InstructionPrinter

  • All Implemented Interfaces:
    Opcode

    public class InstructionPrinter
    extends Object
    implements Opcode
    Simple utility class for printing the bytecode instructions of a method.
    Author:
    Jason T. Greene
    • Constructor Detail

      • InstructionPrinter

        public InstructionPrinter​(PrintStream stream)
        Constructs a InstructionPrinter object.
    • Method Detail

      • print

        public static void print​(CtMethod method,
                                 PrintStream stream)
        Prints the bytecode instructions of a given method.
      • print

        public void print​(CtMethod method)
        Prints the bytecode instructions of a given method.
      • instructionString

        public static String instructionString​(CodeIterator iter,
                                               int pos,
                                               ConstPool pool)
        Gets a string representation of the bytecode instruction at the specified position.