Generated by
JDiff

org.objectweb.asm.util Documentation Differences

This file contains all the changes in documentation in the package org.objectweb.asm.util as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Package org.objectweb.asm.util

Provides some ASM class visitors that can be useful for programming and debugging purposes. These class visitors are normally not used by applications at runtime. This is why they are bundled in an optional asm-util.jar library that is separated from (but requires) the asm.jar library, which contains the core ASM framework. @since ASM 1.3.2
Class ASMifierClassVisitor

A PrintClassVisitorClassVisitor that prints the ASM code that that generates the classes itit visits. This class visitor can be used to quickly quickly write ASM code to generategenerate some given bytecode: The source code printed when visiting thethe Hello class is the the following:

 import org.objectweb.asm.*;
 import java.io.FileOutputStream;


 public class DumpHelloDump implements ConstantsOpcodes {

 public
 
 static void main (String public static byte[] argsdump() throws Exception {


 
         ClassWriter cw = new ClassWriter(false);
 CodeVisitor        FieldVisitor fv;
         MethodVisitor mv;
    cv     AnnotationVisitor av0;


 
         cw.visit(49,
                 ACC_PUBLIC + ACC_SUPER,
               "  "Hello"",
                 null,
    "             "java/lang/Object"",
                 null,);
 
     "    cw.visitSource("Hello.java"", null);


 
         {
 cv            mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main""<init>", "([Ljava/lang/String";()V"", null, null);
 cv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
 cv        mv.visitLdcInsnvisitVarInsn("hello"ALOAD, 0);
 cv            mv.visitMethodInsn(INVOKEVIRTUALINVOKESPECIAL,
 "                    "java/iolang/PrintStream"Object",
 "println"                    "<init>",
 "(Ljava/lang/String                    ";()V"");
 cv            mv.visitInsn(RETURN);
 cv            mv.visitMaxs(21, 1);
             mv.visitEnd();
         }
         {
 cv            mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC,
     "                &ltquot;initmain&gtquot;",
         "            "([Ljava/lang/String;)V"",
                     null,
                     null);
 cv            mv.visitVarInsnvisitFieldInsn(ALOADGETSTATIC,
 0                    "java/lang/System",
                     "out",
                     "Ljava/io/PrintStream;");
             mv.visitLdcInsn("hello");
 cv            mv.visitMethodInsn(INVOKESPECIALINVOKEVIRTUAL,
          "           "java/langio/Object"PrintStream",
          "           &ltquot;initprintln&gtquot;",
               "      "(Ljava/lang/String;)V"");
 cv            mv.visitInsn(RETURN);
 cv            mv.visitMaxs(12, 1);
 }
 cw           mv.visitEnd();


 FileOutputStream os = new FileOutputStream("Dumped.class");    }
 os.write(        cw.toByteArrayvisitEnd());
 os
         return cw.closetoByteArray();
     }
 }
 
 
where Hello is defined by:

 public class Hello {


 
     public static void main (String[] args) {
         System.out.println(""hello"");
     }
 }
 
@author Eric Bruneton,Bruneton @author Eugene Kuleshov
Class ASMifierClassVisitor, constructor ASMifierClassVisitor(PrintWriter)

Constructs a new ASMifierClassVisitor object. @param pw the print writer to be used to print the class.
Class ASMifierClassVisitor, void main(String[])

Prints the ASM source code to generate the given class to the standard output.

Usage: ASMifierClassVisitor [-debug] <fully qualifiedqualified class name or class file name> @param args the command line arguments. @throws Exception if the class cannot be found, or if an IO exception occurs.


Class CheckClassAdapter

A ClassAdapter that checks that its methods are properly properly used. MoreMore precisely this class adapter checks each method call individually, basedbased only on its arguments, but does not check the the sequence of method calls. For example, the invalid sequence visitField(ACC_PUBLIC, "i", "I", null) visitField(ACC_PUBLIC, "i", "D", null) will not be detected by this class adapter. @author Eric Bruneton
Class CheckClassAdapter, constructor CheckClassAdapter(ClassVisitor)

Constructs a new CheckClassAdapter object. @param cv the class visitor to which this adapter must delegate calls.
Class CheckClassAdapter, void main(String[])

Checks a given class.

Usage: CheckClassAdapter CheckClassAdapter <fully qualifiedqualified class name or class file name> @param args the command line arguments. @throws Exception if the class cannot be found, or if an IO exception occurs.


Class TraceClassVisitor

A PrintClassVisitorClassVisitor that prints a disassembled disassembled view of the classes itit visits. This class visitor can be used alone (see the the main method) to disassemble a class. It can also be used in in the middle of classclass visitor chain to trace the class that is visited at a a given point in thisthis chain. This may be uselful for debugging purposes.

The trace printed whenwhen visiting the Hello class is the following:

 // compiled from Helloclass version 49.java
0 (49)
 // access flags 33
 public class Hello {

  // compiled publicfrom: staticHello.java

 main ([Ljava /lang/String;)V
 access flags  1
 GETSTATIC java/lang/System outpublic Ljava/io/PrintStream<;
init> ()V
    LDC "hello"
ALOAD 0
    INVOKEVIRTUAL INVOKESPECIAL java/iolang/PrintStreamObject println<init> (Ljava/lang/String;)V
     RETURN
     MAXSTACK = 2
1
     MAXLOCALS = 1

   public// <init>access ()V
flags 9
   public ALOADstatic 0
main ([Ljava/lang/String;)V
     INVOKESPECIALGETSTATIC java/lang/ObjectSystem out Ljava/io/PrintStream;
     LDC &ltquot;inithello&gtquot;
     INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V
     RETURN
     MAXSTACK = 1
2
     MAXLOCALS = 1

1
 }
 
where Hello is defined by:

 public class Hello {

     public static void main (String[] args) {
         System.out.println(""hello"");
     }
 }
 
@author Eric Bruneton,Bruneton @author Eugene Kuleshov
Class TraceClassVisitor, constructor TraceClassVisitor(ClassVisitor, PrintWriter)

Constructs a new TraceClassVisitor object. @param cv the class visitorClassVisitor to which this adapter mustvisitor delegatedelegates calls. May May be null. @param pw the print writer to be used to print the class.
Class TraceClassVisitor, void main(String[])

Prints a disassembled view of the given class to the standard output.

Usage: TraceClassVisitor [-debug] <fully qualified class name or classclass file name > @param args the command line arguments. @throws Exception if the class cannot be found, or if an IO exception occurs.

Class TraceClassVisitor, ClassVisitor cv

The ClassVisitor to which this visitor delegates delegates calls. May bebe null.