Class InstructionPrinter

  • All Implemented Interfaces:
    Opcode

    public class InstructionPrinter
    extends java.lang.Object
    implements Opcode
    Simple utility class for printing the bytecode instructions of a method.
    • Field Detail

      • opcodes

        private static final java.lang.String[] opcodes
      • stream

        private final java.io.PrintStream stream
    • Constructor Detail

      • InstructionPrinter

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

      • print

        public static void print​(CtMethod method,
                                 java.io.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 java.lang.String instructionString​(CodeIterator iter,
                                                         int pos,
                                                         ConstPool pool)
        Gets a string representation of the bytecode instruction at the specified position.
      • wide

        private static java.lang.String wide​(CodeIterator iter,
                                             int pos)
      • arrayInfo

        private static java.lang.String arrayInfo​(int type)
      • classInfo

        private static java.lang.String classInfo​(ConstPool pool,
                                                  int index)
      • interfaceMethodInfo

        private static java.lang.String interfaceMethodInfo​(ConstPool pool,
                                                            int index)
      • methodInfo

        private static java.lang.String methodInfo​(ConstPool pool,
                                                   int index)
      • fieldInfo

        private static java.lang.String fieldInfo​(ConstPool pool,
                                                  int index)
      • lookupSwitch

        private static java.lang.String lookupSwitch​(CodeIterator iter,
                                                     int pos)
      • tableSwitch

        private static java.lang.String tableSwitch​(CodeIterator iter,
                                                    int pos)
      • ldc

        private static java.lang.String ldc​(ConstPool pool,
                                            int index)