Apache Commons BCEL-The Byte Code Engineering Library

来源:互联网 发布:win10蓝牙共享网络 编辑:程序博客网 时间:2024/06/16 00:55

Extensions and improvements of the programming language Java and its related execution environment (Java Virtual Machine, JVM) are the subject of a large number of research projects and proposals. There are projects, for instance, to add parameterized types to Java, to implement Aspect-Oriented Programming, to perform sophisticated static analysis, and to improve the run-time performance.

Since Java classes are compiled into portable binary class files (called byte code), it is the most convenient and platform-independent way to implement these improvements not by writing a new compiler or changing the JVM, but by transforming the byte code. These transformations can either be performed after compile-time, or at load-time. Many programmers are doing this by implementing their own specialized byte code manipulation tools, which are, however, restricted in the range of their re-usability.

To deal with the necessary class file transformations, we introduce an API that helps developers to conveniently implement their transformations.



The BCEL API (Byte Code Engineering Library), formerly known as JavaClass, is a toolkit for the static analysis and dynamic creation or transformation of Java class files. It enables developers to implement the desired features on a high level of abstraction without handling all the internal details of the Java class file format and thus re-inventing the wheel every time.