Javassist is a powerful new library in the field of bytecode engineering. It
allows developers to add a new method to a compiled class, modify a method
body, and so forth. Unlike other similar libraries, Javassist enables this
without knowledge of Java bytecode or the structure of a class file.
Bytecode engineering is used to manipulate and modify compiled Java classes
and to programmatically create new classes. This engineering can happen
either at runtime or at compile time. Some technologies use bytecode
manipulation to optimize or enhance existing Java classes. Other technologies
use it to make themselves easier to use or to avoid cumbersome code
generators. For instance, the JDO 1.0 (Java Data Objects) specification
requires bytecode enhancement of precompiled Java to add database persistence
code to simple Java classes. In Aspect-Oriented Programming, some of t... (more)