Class Printer

java.lang.Object
org.objectweb.asm.util.Printer
Direct Known Subclasses:
ASMifier, Textifier

public abstract class Printer extends Object
An abstract converter from visit events to text.
  • Field Details

    • OPCODES

      public static final String[] OPCODES
      The names of the Java Virtual Machine opcodes.
    • TYPES

      public static final String[] TYPES
      The names of the operand values of the MethodVisitor.visitIntInsn(int, int) method when opcode is NEWARRAY.
    • HANDLE_TAG

      public static final String[] HANDLE_TAG
      The names of the tag field values for Handle.
    • UNSUPPORTED_OPERATION

      private static final String UNSUPPORTED_OPERATION
      Message of the UnsupportedOperationException thrown by methods which must be overridden.
      See Also:
    • api

      protected final int api
      The ASM API version implemented by this class. The value of this field must be one of Opcodes.ASM4, Opcodes.ASM5, Opcodes.ASM6, Opcodes.ASM7, Opcodes.ASM8 or Opcodes.ASM9.
    • stringBuilder

      protected final StringBuilder stringBuilder
      The builder used to build strings in the various visit methods.
    • text

      public final List<Object> text
      The text to be printed. Since the code of methods is not necessarily visited in sequential order, one method after the other, but can be interlaced (some instructions from method one, then some instructions from method two, then some instructions from method one again...), it is not possible to print the visited instructions directly to a sequential stream. A class is therefore printed in a two steps process: a string tree is constructed during the visit, and printed to a sequential stream at the end of the visit. This string tree is stored in this field, as a string list that can contain other string lists, which can themselves contain other string lists, and so on.
  • Constructor Details

  • Method Details