Class Textifier

java.lang.Object
org.objectweb.asm.util.Printer
org.objectweb.asm.util.Textifier

public class Textifier extends Printer
A Printer that prints a disassembled view of the classes it visits.
  • Field Details

  • Constructor Details

    • Textifier

      public Textifier()
      Constructs a new Textifier. Subclasses must not use this constructor. Instead, they must use the Textifier(int) version.
      Throws:
      IllegalStateException - If a subclass calls this constructor.
    • Textifier

      protected Textifier(int api)
      Constructs a new Textifier.
      Parameters:
      api - the ASM API version implemented by this visitor. Must be one of the ASMx values in Opcodes.
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Prints a disassembled view of the given class to the standard output.

      Usage: Textifier [-nodebug] <binary class name or class file name >

      Parameters:
      args - the command line arguments.
      Throws:
      IOException - if the class cannot be found, or if an IOException occurs.
    • visit

      public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
      Description copied from class: Printer
      Class header. See ClassVisitor.visit(int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).
      Specified by:
      visit in class Printer
      Parameters:
      version - the class version. The minor version is stored in the 16 most significant bits, and the major version in the 16 least significant bits.
      access - the class's access flags (see Opcodes). This parameter also indicates if the class is deprecated.
      name - the internal name of the class (see Type.getInternalName()).
      signature - the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces.
      superName - the internal of name of the super class (see Type.getInternalName()). For interfaces, the super class is Object. May be null, but only for the Object class.
      interfaces - the internal names of the class's interfaces (see Type.getInternalName()). May be null.
    • visitSource

      public void visitSource(String file, String debug)
      Description copied from class: Printer
      Class source. See ClassVisitor.visitSource(java.lang.String, java.lang.String).
      Specified by:
      visitSource in class Printer
      Parameters:
      file - the name of the source file from which the class was compiled. May be null.
      debug - additional debug information to compute the correspondence between source and compiled elements of the class. May be null.
    • visitModule

      public Printer visitModule(String name, int access, String version)
      Description copied from class: Printer
      Module. See ClassVisitor.visitModule(java.lang.String, int, java.lang.String).
      Overrides:
      visitModule in class Printer
      Parameters:
      name - the fully qualified name (using dots) of the module.
      access - the module access flags, among ACC_OPEN, ACC_SYNTHETIC and ACC_MANDATED.
      version - the module version, or null.
      Returns:
      the printer.
    • visitNestHost

      public void visitNestHost(String nestHost)
      Description copied from class: Printer
      Visits the nest host class of the class. A nest is a set of classes of the same package that share access to their private members. One of these classes, called the host, lists the other members of the nest, which in turn should link to the host of their nest. This method must be called only once and only if the visited class is a non-host member of a nest. A class is implicitly its own nest, so it's invalid to call this method with the visited class name as argument.
      Overrides:
      visitNestHost in class Printer
      Parameters:
      nestHost - the internal name of the host class of the nest (see Type.getInternalName()).
    • visitOuterClass

      public void visitOuterClass(String owner, String name, String descriptor)
      Description copied from class: Printer
      Class outer class. See ClassVisitor.visitOuterClass(java.lang.String, java.lang.String, java.lang.String).
      Specified by:
      visitOuterClass in class Printer
      Parameters:
      owner - internal name of the enclosing class of the class (see Type.getInternalName()).
      name - the name of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.
      descriptor - the descriptor of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.
    • visitClassAnnotation

      public Textifier visitClassAnnotation(String descriptor, boolean visible)
      Description copied from class: Printer
      Class annotation. See ClassVisitor.visitAnnotation(java.lang.String, boolean).
      Specified by:
      visitClassAnnotation in class Printer
      Parameters:
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitClassTypeAnnotation

      public Printer visitClassTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Class type annotation. See ClassVisitor.visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitClassTypeAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.CLASS_TYPE_PARAMETER, TypeReference.CLASS_TYPE_PARAMETER_BOUND or TypeReference.CLASS_EXTENDS. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitClassAttribute

      public void visitClassAttribute(org.objectweb.asm.Attribute attribute)
      Description copied from class: Printer
      Class attribute. See ClassVisitor.visitAttribute(org.objectweb.asm.Attribute).
      Specified by:
      visitClassAttribute in class Printer
      Parameters:
      attribute - an attribute.
    • visitNestMember

      public void visitNestMember(String nestMember)
      Description copied from class: Printer
      Visits a member of the nest. A nest is a set of classes of the same package that share access to their private members. One of these classes, called the host, lists the other members of the nest, which in turn should link to the host of their nest. This method must be called only if the visited class is the host of a nest. A nest host is implicitly a member of its own nest, so it's invalid to call this method with the visited class name as argument.
      Overrides:
      visitNestMember in class Printer
      Parameters:
      nestMember - the internal name of a nest member (see Type.getInternalName()).
    • visitPermittedSubclass

      public void visitPermittedSubclass(String permittedSubclass)
      Description copied from class: Printer
      Visits a permitted subclasses. A permitted subclass is one of the allowed subclasses of the current class. See ClassVisitor.visitPermittedSubclass(String).
      Overrides:
      visitPermittedSubclass in class Printer
      Parameters:
      permittedSubclass - the internal name of a permitted subclass (see Type.getInternalName()).
    • visitInnerClass

      public void visitInnerClass(String name, String outerName, String innerName, int access)
      Description copied from class: Printer
      Class inner name. See ClassVisitor.visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int).
      Specified by:
      visitInnerClass in class Printer
      Parameters:
      name - the internal name of an inner class (see Type.getInternalName()).
      outerName - the internal name of the class to which the inner class belongs (see Type.getInternalName()). May be null for not member classes.
      innerName - the (simple) name of the inner class inside its enclosing class. May be null for anonymous inner classes.
      access - the access flags of the inner class as originally declared in the enclosing class.
    • visitRecordComponent

      public Printer visitRecordComponent(String name, String descriptor, String signature)
      Description copied from class: Printer
      Visits a record component of the class. See ClassVisitor.visitRecordComponent(String, String, String).
      Overrides:
      visitRecordComponent in class Printer
      Parameters:
      name - the field's name.
      descriptor - the record component descriptor (see Type).
      signature - the record component signature. May be null if the record component type does not use generic types.
      Returns:
      a visitor to visit this record component annotations and attributes, or null if this class visitor is not interested in visiting these annotations and attributes.
    • visitField

      public Textifier visitField(int access, String name, String descriptor, String signature, Object value)
      Description copied from class: Printer
      Class field. See ClassVisitor.visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object).
      Specified by:
      visitField in class Printer
      Parameters:
      access - the field's access flags (see Opcodes). This parameter also indicates if the field is synthetic and/or deprecated.
      name - the field's name.
      descriptor - the field's descriptor (see Type).
      signature - the field's signature. May be null if the field's type does not use generic types.
      value - the field's initial value. This parameter, which may be null if the field does not have an initial value, must be an Integer, a Float, a Long, a Double or a String (for int, float, long or String fields respectively). This parameter is only used for static fields. Its value is ignored for non static fields, which must be initialized through bytecode instructions in constructors or methods.
      Returns:
      the printer.
    • visitMethod

      public Textifier visitMethod(int access, String name, String descriptor, String signature, String[] exceptions)
      Description copied from class: Printer
      Class method. See ClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).
      Specified by:
      visitMethod in class Printer
      Parameters:
      access - the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated.
      name - the method's name.
      descriptor - the method's descriptor (see Type).
      signature - the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
      exceptions - the internal names of the method's exception classes (see Type.getInternalName()). May be null.
      Returns:
      the printer.
    • visitClassEnd

      public void visitClassEnd()
      Description copied from class: Printer
      Class end. See ClassVisitor.visitEnd().
      Specified by:
      visitClassEnd in class Printer
    • visitMainClass

      public void visitMainClass(String mainClass)
      Description copied from class: Printer
      Module main class. See ModuleVisitor.visitMainClass(java.lang.String).
      Overrides:
      visitMainClass in class Printer
      Parameters:
      mainClass - the internal name of the main class of the current module (see Type.getInternalName()).
    • visitPackage

      public void visitPackage(String packaze)
      Description copied from class: Printer
      Module package. See ModuleVisitor.visitPackage(java.lang.String).
      Overrides:
      visitPackage in class Printer
      Parameters:
      packaze - the internal name of a package (see Type.getInternalName()).
    • visitRequire

      public void visitRequire(String require, int access, String version)
      Description copied from class: Printer
      Module require. See ModuleVisitor.visitRequire(java.lang.String, int, java.lang.String).
      Overrides:
      visitRequire in class Printer
      Parameters:
      require - the fully qualified name (using dots) of the dependence.
      access - the access flag of the dependence among ACC_TRANSITIVE, ACC_STATIC_PHASE, ACC_SYNTHETIC and ACC_MANDATED.
      version - the module version at compile time, or null.
    • visitExport

      public void visitExport(String packaze, int access, String... modules)
      Description copied from class: Printer
      Module export. See ModuleVisitor.visitExport(java.lang.String, int, java.lang.String...).
      Overrides:
      visitExport in class Printer
      Parameters:
      packaze - the internal name of the exported package (see Type.getInternalName()).
      access - the access flag of the exported package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
      modules - the fully qualified names (using dots) of the modules that can access the public classes of the exported package, or null.
    • visitOpen

      public void visitOpen(String packaze, int access, String... modules)
      Description copied from class: Printer
      Module open. See ModuleVisitor.visitOpen(java.lang.String, int, java.lang.String...).
      Overrides:
      visitOpen in class Printer
      Parameters:
      packaze - the internal name of the opened package (see Type.getInternalName()).
      access - the access flag of the opened package, valid values are among ACC_SYNTHETIC and ACC_MANDATED.
      modules - the fully qualified names (using dots) of the modules that can use deep reflection to the classes of the open package, or null.
    • visitUse

      public void visitUse(String use)
      Description copied from class: Printer
      Module use. See ModuleVisitor.visitUse(java.lang.String).
      Overrides:
      visitUse in class Printer
      Parameters:
      use - the internal name of the service (see Type.getInternalName()).
    • visitProvide

      public void visitProvide(String provide, String... providers)
      Description copied from class: Printer
      Module provide. See ModuleVisitor.visitProvide(java.lang.String, java.lang.String...).
      Overrides:
      visitProvide in class Printer
      Parameters:
      provide - the internal name of the service (see Type.getInternalName()).
      providers - the internal names of the implementations of the service (there is at least one provider).
    • visitModuleEnd

      public void visitModuleEnd()
      Description copied from class: Printer
      Module end. See ModuleVisitor.visitEnd().
      Overrides:
      visitModuleEnd in class Printer
    • visit

      public void visit(String name, Object value)
      Description copied from class: Printer
      Annotation value. See AnnotationVisitor.visit(java.lang.String, java.lang.Object).
      Specified by:
      visit in class Printer
      Parameters:
      name - the value name.
      value - the actual value, whose type must be Byte, Boolean, Character, Short, Integer , Long, Float, Double, String or Type of Type.OBJECT or Type.ARRAY sort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to using Printer.visitArray(java.lang.String) and visiting each array element in turn, but is more convenient).
    • visitEnum

      public void visitEnum(String name, String descriptor, String value)
      Description copied from class: Printer
      Annotation enum value. See AnnotationVisitor.visitEnum(java.lang.String, java.lang.String, java.lang.String).
      Specified by:
      visitEnum in class Printer
      Parameters:
      name - the value name.
      descriptor - the class descriptor of the enumeration class.
      value - the actual enumeration value.
    • visitAnnotation

      public Textifier visitAnnotation(String name, String descriptor)
      Description copied from class: Printer
      Nested annotation value. See AnnotationVisitor.visitAnnotation(java.lang.String, java.lang.String).
      Specified by:
      visitAnnotation in class Printer
      Parameters:
      name - the value name.
      descriptor - the class descriptor of the nested annotation class.
      Returns:
      the printer.
    • visitArray

      public Textifier visitArray(String name)
      Description copied from class: Printer
      Annotation array value. See AnnotationVisitor.visitArray(java.lang.String).
      Specified by:
      visitArray in class Printer
      Parameters:
      name - the value name.
      Returns:
      the printer.
    • visitAnnotationEnd

      public void visitAnnotationEnd()
      Description copied from class: Printer
      Annotation end. See AnnotationVisitor.visitEnd().
      Specified by:
      visitAnnotationEnd in class Printer
    • visitRecordComponentAnnotation

      public Textifier visitRecordComponentAnnotation(String descriptor, boolean visible)
      Description copied from class: Printer
      Visits an annotation of the record component. See RecordComponentVisitor.visitAnnotation(java.lang.String, boolean).
      Overrides:
      visitRecordComponentAnnotation in class Printer
      Parameters:
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
    • visitRecordComponentTypeAnnotation

      public Printer visitRecordComponentTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Visits an annotation on a type in the record component signature. See RecordComponentVisitor.visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitRecordComponentTypeAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.CLASS_TYPE_PARAMETER, TypeReference.CLASS_TYPE_PARAMETER_BOUND or TypeReference.CLASS_EXTENDS. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
    • visitRecordComponentAttribute

      public void visitRecordComponentAttribute(org.objectweb.asm.Attribute attribute)
      Description copied from class: Printer
      Visits a non standard attribute of the record component. See RecordComponentVisitor.visitAttribute(org.objectweb.asm.Attribute).
      Overrides:
      visitRecordComponentAttribute in class Printer
      Parameters:
      attribute - an attribute.
    • visitRecordComponentEnd

      public void visitRecordComponentEnd()
      Description copied from class: Printer
      Visits the end of the record component. See RecordComponentVisitor.visitEnd(). This method, which is the last one to be called, is used to inform the visitor that everything have been visited.
      Overrides:
      visitRecordComponentEnd in class Printer
    • visitFieldAnnotation

      public Textifier visitFieldAnnotation(String descriptor, boolean visible)
      Description copied from class: Printer
      Field annotation. See FieldVisitor.visitAnnotation(java.lang.String, boolean).
      Specified by:
      visitFieldAnnotation in class Printer
      Parameters:
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitFieldTypeAnnotation

      public Printer visitFieldTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Field type annotation. See FieldVisitor.visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitFieldTypeAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.FIELD. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitFieldAttribute

      public void visitFieldAttribute(org.objectweb.asm.Attribute attribute)
      Description copied from class: Printer
      Field attribute. See FieldVisitor.visitAttribute(org.objectweb.asm.Attribute).
      Specified by:
      visitFieldAttribute in class Printer
      Parameters:
      attribute - an attribute.
    • visitFieldEnd

      public void visitFieldEnd()
      Description copied from class: Printer
      Field end. See FieldVisitor.visitEnd().
      Specified by:
      visitFieldEnd in class Printer
    • visitParameter

      public void visitParameter(String name, int access)
      Description copied from class: Printer
      Method parameter. See MethodVisitor.visitParameter(String, int).
      Overrides:
      visitParameter in class Printer
      Parameters:
      name - parameter name or null if none is provided.
      access - the parameter's access flags, only ACC_FINAL, ACC_SYNTHETIC or/and ACC_MANDATED are allowed (see Opcodes).
    • visitAnnotationDefault

      public Textifier visitAnnotationDefault()
      Description copied from class: Printer
      Method default annotation. See MethodVisitor.visitAnnotationDefault().
      Specified by:
      visitAnnotationDefault in class Printer
      Returns:
      the printer.
    • visitMethodAnnotation

      public Textifier visitMethodAnnotation(String descriptor, boolean visible)
      Description copied from class: Printer
      Method annotation. See MethodVisitor.visitAnnotation(java.lang.String, boolean).
      Specified by:
      visitMethodAnnotation in class Printer
      Parameters:
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitMethodTypeAnnotation

      public Printer visitMethodTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Method type annotation. See MethodVisitor.visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitMethodTypeAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.METHOD_TYPE_PARAMETER, TypeReference.METHOD_TYPE_PARAMETER_BOUND, TypeReference.METHOD_RETURN, TypeReference.METHOD_RECEIVER, TypeReference.METHOD_FORMAL_PARAMETER or TypeReference.THROWS. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitAnnotableParameterCount

      public Textifier visitAnnotableParameterCount(int parameterCount, boolean visible)
      Description copied from class: Printer
      Number of method parameters that can have annotations. See MethodVisitor.visitAnnotableParameterCount(int, boolean).
      Overrides:
      visitAnnotableParameterCount in class Printer
      Parameters:
      parameterCount - the number of method parameters than can have annotations. This number must be less or equal than the number of parameter types in the method descriptor. It can be strictly less when a method has synthetic parameters and when these parameters are ignored when computing parameter indices for the purpose of parameter annotations (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
      visible - true to define the number of method parameters that can have annotations visible at runtime, false to define the number of method parameters that can have annotations invisible at runtime.
      Returns:
      the printer.
    • visitParameterAnnotation

      public Textifier visitParameterAnnotation(int parameter, String descriptor, boolean visible)
      Description copied from class: Printer
      Method parameter annotation. See MethodVisitor.visitParameterAnnotation(int, java.lang.String, boolean).
      Specified by:
      visitParameterAnnotation in class Printer
      Parameters:
      parameter - the parameter index. This index must be strictly smaller than the number of parameters in the method descriptor, and strictly smaller than the parameter count specified in Printer.visitAnnotableParameterCount(int, boolean). Important note: a parameter index i is not required to correspond to the i'th parameter descriptor in the method descriptor, in particular in case of synthetic parameters (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitMethodAttribute

      public void visitMethodAttribute(org.objectweb.asm.Attribute attribute)
      Description copied from class: Printer
      Method attribute. See MethodVisitor.visitAttribute(org.objectweb.asm.Attribute).
      Specified by:
      visitMethodAttribute in class Printer
      Parameters:
      attribute - an attribute.
    • visitCode

      public void visitCode()
      Description copied from class: Printer
      Method start. See MethodVisitor.visitCode().
      Specified by:
      visitCode in class Printer
    • visitFrame

      public void visitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack)
      Description copied from class: Printer
      Method stack frame. See MethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[]).
      Specified by:
      visitFrame in class Printer
      Parameters:
      type - the type of this stack map frame. Must be Opcodes.F_NEW for expanded frames, or Opcodes.F_FULL, Opcodes.F_APPEND, Opcodes.F_CHOP, Opcodes.F_SAME or Opcodes.F_APPEND, Opcodes.F_SAME1 for compressed frames.
      numLocal - the number of local variables in the visited frame.
      local - the local variable types in this frame. This array must not be modified. Primitive types are represented by Opcodes.TOP, Opcodes.INTEGER, Opcodes.FLOAT, Opcodes.LONG, Opcodes.DOUBLE, Opcodes.NULL or Opcodes.UNINITIALIZED_THIS (long and double are represented by a single element). Reference types are represented by String objects (representing internal names, see Type.getInternalName()), and uninitialized types by Label objects (this label designates the NEW instruction that created this uninitialized value).
      numStack - the number of operand stack elements in the visited frame.
      stack - the operand stack types in this frame. This array must not be modified. Its content has the same format as the "local" array.
    • visitInsn

      public void visitInsn(int opcode)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitInsn(int)
      Specified by:
      visitInsn in class Printer
      Parameters:
      opcode - the opcode of the instruction to be visited. This opcode is either NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, or MONITOREXIT.
    • visitIntInsn

      public void visitIntInsn(int opcode, int operand)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitIntInsn(int, int).
      Specified by:
      visitIntInsn in class Printer
      Parameters:
      opcode - the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH or NEWARRAY.
      operand - the operand of the instruction to be visited.
      When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE.
      When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE.
      When opcode is NEWARRAY, operand value should be one of Opcodes.T_BOOLEAN, Opcodes.T_CHAR, Opcodes.T_FLOAT, Opcodes.T_DOUBLE, Opcodes.T_BYTE, Opcodes.T_SHORT, Opcodes.T_INT or Opcodes.T_LONG.
    • visitVarInsn

      public void visitVarInsn(int opcode, int varIndex)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitVarInsn(int, int).
      Specified by:
      visitVarInsn in class Printer
      Parameters:
      opcode - the opcode of the local variable instruction to be visited. This opcode is either ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
      varIndex - the operand of the instruction to be visited. This operand is the index of a local variable.
    • visitTypeInsn

      public void visitTypeInsn(int opcode, String type)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitTypeInsn(int, java.lang.String).
      Specified by:
      visitTypeInsn in class Printer
      Parameters:
      opcode - the opcode of the type instruction to be visited. This opcode is either NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
      type - the operand of the instruction to be visited. This operand must be the internal name of an object or array class (see Type.getInternalName()).
    • visitFieldInsn

      public void visitFieldInsn(int opcode, String owner, String name, String descriptor)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitFieldInsn(int, java.lang.String, java.lang.String, java.lang.String).
      Specified by:
      visitFieldInsn in class Printer
      Parameters:
      opcode - the opcode of the type instruction to be visited. This opcode is either GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
      owner - the internal name of the field's owner class (see Type.getInternalName()).
      name - the field's name.
      descriptor - the field's descriptor (see Type).
    • visitMethodInsn

      public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String).
      Overrides:
      visitMethodInsn in class Printer
      Parameters:
      opcode - the opcode of the type instruction to be visited. This opcode is either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
      owner - the internal name of the method's owner class (see Type.getInternalName()).
      name - the method's name.
      descriptor - the method's descriptor (see Type).
      isInterface - if the method's owner class is an interface.
    • visitInvokeDynamicInsn

      public void visitInvokeDynamicInsn(String name, String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, Object... bootstrapMethodArguments)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitInvokeDynamicInsn(java.lang.String, java.lang.String, org.objectweb.asm.Handle, java.lang.Object...).
      Specified by:
      visitInvokeDynamicInsn in class Printer
      Parameters:
      name - the method's name.
      descriptor - the method's descriptor (see Type).
      bootstrapMethodHandle - the bootstrap method.
      bootstrapMethodArguments - the bootstrap method constant arguments. Each argument must be an Integer, Float, Long, Double, String, Type or Handle value. This method is allowed to modify the content of the array so a caller should expect that this array may change.
    • visitJumpInsn

      public void visitJumpInsn(int opcode, org.objectweb.asm.Label label)
      Description copied from class: Printer
      Method jump instruction. See MethodVisitor.visitJumpInsn(int, org.objectweb.asm.Label).
      Specified by:
      visitJumpInsn in class Printer
      Parameters:
      opcode - the opcode of the type instruction to be visited. This opcode is either IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL.
      label - the operand of the instruction to be visited. This operand is a label that designates the instruction to which the jump instruction may jump.
    • visitLabel

      public void visitLabel(org.objectweb.asm.Label label)
      Description copied from class: Printer
      Method label. See MethodVisitor.visitLabel(org.objectweb.asm.Label).
      Specified by:
      visitLabel in class Printer
      Parameters:
      label - a Label object.
    • visitLdcInsn

      public void visitLdcInsn(Object value)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitLdcInsn(java.lang.Object).
      Specified by:
      visitLdcInsn in class Printer
      Parameters:
      value - the constant to be loaded on the stack. This parameter must be a non null Integer, a Float, a Long, a Double, a String, a Type of OBJECT or ARRAY sort for .class constants, for classes whose version is 49, a Type of METHOD sort for MethodType, a Handle for MethodHandle constants, for classes whose version is 51 or a ConstantDynamic for a constant dynamic for classes whose version is 55.
    • visitIincInsn

      public void visitIincInsn(int varIndex, int increment)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitIincInsn(int, int).
      Specified by:
      visitIincInsn in class Printer
      Parameters:
      varIndex - index of the local variable to be incremented.
      increment - amount to increment the local variable by.
    • visitTableSwitchInsn

      public void visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitTableSwitchInsn(int, int, org.objectweb.asm.Label, org.objectweb.asm.Label...).
      Specified by:
      visitTableSwitchInsn in class Printer
      Parameters:
      min - the minimum key value.
      max - the maximum key value.
      dflt - beginning of the default handler block.
      labels - beginnings of the handler blocks. labels[i] is the beginning of the handler block for the min + i key.
    • visitLookupSwitchInsn

      public void visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitLookupSwitchInsn(org.objectweb.asm.Label, int[], org.objectweb.asm.Label[]).
      Specified by:
      visitLookupSwitchInsn in class Printer
      Parameters:
      dflt - beginning of the default handler block.
      keys - the values of the keys.
      labels - beginnings of the handler blocks. labels[i] is the beginning of the handler block for the keys[i] key.
    • visitMultiANewArrayInsn

      public void visitMultiANewArrayInsn(String descriptor, int numDimensions)
      Description copied from class: Printer
      Method instruction. See MethodVisitor.visitMultiANewArrayInsn(java.lang.String, int).
      Specified by:
      visitMultiANewArrayInsn in class Printer
      Parameters:
      descriptor - an array type descriptor (see Type).
      numDimensions - the number of dimensions of the array to allocate.
    • visitInsnAnnotation

      public Printer visitInsnAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Instruction type annotation. See MethodVisitor.visitInsnAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitInsnAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.INSTANCEOF, TypeReference.NEW, TypeReference.CONSTRUCTOR_REFERENCE, TypeReference.METHOD_REFERENCE, TypeReference.CAST, TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT, TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT, TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT, or TypeReference.METHOD_REFERENCE_TYPE_ARGUMENT. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitTryCatchBlock

      public void visitTryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, String type)
      Description copied from class: Printer
      Method exception handler. See MethodVisitor.visitTryCatchBlock(org.objectweb.asm.Label, org.objectweb.asm.Label, org.objectweb.asm.Label, java.lang.String).
      Specified by:
      visitTryCatchBlock in class Printer
      Parameters:
      start - the beginning of the exception handler's scope (inclusive).
      end - the end of the exception handler's scope (exclusive).
      handler - the beginning of the exception handler's code.
      type - the internal name of the type of exceptions handled by the handler (see Type.getInternalName()), or null to catch any exceptions (for "finally" blocks).
    • visitTryCatchAnnotation

      public Printer visitTryCatchAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Description copied from class: Printer
      Try catch block type annotation. See MethodVisitor.visitTryCatchAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitTryCatchAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.EXCEPTION_PARAMETER. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitLocalVariable

      public void visitLocalVariable(String name, String descriptor, String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)
      Description copied from class: Printer
      Method debug info. See MethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, org.objectweb.asm.Label, org.objectweb.asm.Label, int).
      Specified by:
      visitLocalVariable in class Printer
      Parameters:
      name - the name of a local variable.
      descriptor - the type descriptor of this local variable.
      signature - the type signature of this local variable. May be null if the local variable type does not use generic types.
      start - the first instruction corresponding to the scope of this local variable (inclusive).
      end - the last instruction corresponding to the scope of this local variable (exclusive).
      index - the local variable's index.
    • visitLocalVariableAnnotation

      public Printer visitLocalVariableAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, org.objectweb.asm.Label[] start, org.objectweb.asm.Label[] end, int[] index, String descriptor, boolean visible)
      Description copied from class: Printer
      Local variable type annotation. See MethodVisitor.visitTryCatchAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean).
      Overrides:
      visitLocalVariableAnnotation in class Printer
      Parameters:
      typeRef - a reference to the annotated type. The sort of this type reference must be TypeReference.LOCAL_VARIABLE or TypeReference.RESOURCE_VARIABLE. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      start - the fist instructions corresponding to the continuous ranges that make the scope of this local variable (inclusive).
      end - the last instructions corresponding to the continuous ranges that make the scope of this local variable (exclusive). This array must have the same size as the 'start' array.
      index - the local variable's index in each range. This array must have the same size as the 'start' array.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      the printer.
    • visitLineNumber

      public void visitLineNumber(int line, org.objectweb.asm.Label start)
      Description copied from class: Printer
      Method debug info. See MethodVisitor.visitLineNumber(int, org.objectweb.asm.Label).
      Specified by:
      visitLineNumber in class Printer
      Parameters:
      line - a line number. This number refers to the source file from which the class was compiled.
      start - the first instruction corresponding to this line number.
    • visitMaxs

      public void visitMaxs(int maxStack, int maxLocals)
      Description copied from class: Printer
      Method max stack and max locals. See MethodVisitor.visitMaxs(int, int).
      Specified by:
      visitMaxs in class Printer
      Parameters:
      maxStack - maximum stack size of the method.
      maxLocals - maximum number of local variables for the method.
    • visitMethodEnd

      public void visitMethodEnd()
      Description copied from class: Printer
      Method end. See MethodVisitor.visitEnd().
      Specified by:
      visitMethodEnd in class Printer
    • visitAnnotation

      public Textifier visitAnnotation(String descriptor, boolean visible)
      Prints a disassembled view of the given annotation.
      Parameters:
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      a visitor to visit the annotation values.
    • visitTypeAnnotation

      public Textifier visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, String descriptor, boolean visible)
      Prints a disassembled view of the given type annotation.
      Parameters:
      typeRef - a reference to the annotated type. See TypeReference.
      typePath - the path to the annotated type argument, wildcard bound, array element type, or static inner type within 'typeRef'. May be null if the annotation targets 'typeRef' as a whole.
      descriptor - the class descriptor of the annotation class.
      visible - true if the annotation is visible at runtime.
      Returns:
      a visitor to visit the annotation values.
    • visitAttribute

      public void visitAttribute(org.objectweb.asm.Attribute attribute)
      Prints a disassembled view of the given attribute.
      Parameters:
      attribute - an attribute.
    • appendDescriptor

      protected void appendDescriptor(int type, String value)
      Appends an internal name, a type descriptor or a type signature to Printer.stringBuilder.
      Parameters:
      type - the type of 'value'. Must be one of INTERNAL_NAME, FIELD_DESCRIPTOR, FIELD_SIGNATURE, METHOD_DESCRIPTOR, METHOD_SIGNATURE, CLASS_SIGNATURE or HANDLE_DESCRIPTOR.
      value - an internal name (see Type.getInternalName()), type descriptor or a type signature. May be null.
    • appendLabel

      protected void appendLabel(org.objectweb.asm.Label label)
      Appends the name of the given label to Printer.stringBuilder. Constructs a new label name if the given label does not yet have one.
      Parameters:
      label - a label.
    • appendHandle

      protected void appendHandle(org.objectweb.asm.Handle handle)
      Appends a string representation of the given handle to Printer.stringBuilder.
      Parameters:
      handle - a handle.
    • createTextifier

      protected Textifier createTextifier()
      Creates a new Textifier.
      Returns:
      a new Textifier.