Package org.plumelib.bcelutil


package org.plumelib.bcelutil
Utility methods for BCEL, the bytecode engineering library.

The Byte Code Engineering Library (Apache Commons BCEL) enables users to analyze, create, and manipulate (binary) Java class files (those ending with .class). Classes are represented by objects which contain all the symbolic information of the given class: methods, fields, and byte code instructions, in particular. Such objects can be read from an existing file, be transformed by a program (e.g., a class loader at run time) and written to a file again.

If one wishes to inspect a Java class file, a rough program template would be as follows:

   import org.apache.bcel.classfile.*;

   try {
     // Parse the bytes of the classfile, die on any errors
     ClassParser parser = new ClassParser("path to class file of interest");
     JavaClass jc = parser.parse();
   } catch (Exception e) {
     throw new RuntimeException("Unexpected error", e);
   }
 

At this point one would use the methods of JavaClass, the other members of the

invalid @link
org.apache.bcel.classfile
package and BcelUtil to explore the class file of interest.
See Also:
  • Classes
    Class
    Description
    Static utility methods for working with BCEL.
    This class provides utility methods to maintain and modify a method's InstructionList within a Java class file.
    This class is dummy instruction constraint visitor that does no constraint checking at all.
    A logging class with the following features.
    This class provides utility methods to maintain and modify a method's StackMapTable within a Java class file.
    Stores the types on the stack at each instruction (identified by byte code offset) in a method.
    This is a slightly modified version of Pass3bVerifier from BCEL.