Javassist is a sub project of JBoss

Javassist

Welcome...

Javassist (Java Programming Assistant) makes Java bytecode manipulation simple. It is a class library for editing bytecodes in Java; it enables Java programs to define a new class at runtime and to modify a class file when the JVM loads it. Unlike other similar bytecode editors, Javassist provides two levels of API: source level and bytecode level. If the users use the source-level API, they can edit a class file without knowledge of the specifications of the Java bytecode. The whole API is designed with only the vocabulary of the Java language. You can even specify inserted bytecode in the form of source text; Javassist compiles it on the fly. On the other hand, the bytecode-level API allows the users to directly edit a class file as other editors.

Aspect Oriented Programming: Javassist can be a good tool for adding new methods into a class and for inserting before/after/around advice at the both caller and callee sides.

Reflection: One of applications of Javassist is runtime reflection; Javassist enables Java programs to use a metaobject that controls method calls on base-level objects. No specialized compiler or virtual machine are needed.

Availability... Javassist version 3.18.2-GA is available (May 27, 2014). new
This version is distributed under the triple license of the MPL, the LGPL, and the Apache License.
Info...

Join our discussion forums:

Publications...

An Easy-to-Use Toolkit for Efficient Java Bytecode Translators

Shigeru Chiba and Muga Nishizawa
Proc. of 2nd Int'l Conf. on Generative Programming and Component Engineering (GPCE '03),
LNCS 2830, pp.364-376, Springer-Verlag, 2003.
(The performance of Javassist)

Using HotSwap for Implementing Dynamic AOP Systems

Shigeru Chiba, Yoshiki Sato, and Michiaki Tatsubori
ECOOP'03 Workshop on Advancing the State of the Art in Runtime Inspection (ASARTI), July 21st, 2003.
(Dynamic AOP, An Application of Javassist)

AOP in the Academia

Shigeru Chiba, JBossTwo AOP Panel, June 2003.

A Bytecode Translator for Distributed Execution of "Legacy" Java Software

Michiaki Tatsubori, Toshiyuki Sasaki, Shigeru Chiba and Kozo Itano
ECOOP 2001 -- Object-Oriented Programming, LNCS 2072, Springer Verlag, pp.236-255, 2001.
(An application of Javassist)

Load-time Structural Reflection in Java

Shigeru Chiba
ECOOP 2000 -- Object-Oriented Programming, LNCS 1850, Springer Verlag, page 313-336, 2000.
(The overview of Javassist)

Javassist --- A Reflection-based Programming Wizard for Java
Shigeru Chiba
In Proceedings of the ACM OOPSLA'98 Workshop on Reflective Programming in C++ and Java October, 1998.
(An very early sketch of the design of Javassist)
Related Work...

We have developed a light-weight but powerful AOP framework on top of Javassist.
Please visit our GluonJ site.

We were also developing other reflective systems for C++ and Java.

OpenC++
An extensible C++ preprocessor based on compile-time reflection.

OJ
An extensible Java preprocessor based on compile-time reflection.

Old Versions...

Javassist version 2.4 is also available (February 20, 2003)
This version is distributed under the Mozilla Public License 1.1.


Javassist version 1.0 is also available (July 24, 2001).

Acknowledgment... The development of Javassist was supported in part by the PRESTO and CREST programs of Japan Science and Technology Agency.

[Last Updated: June 13, 2014]

Shigeru Chiba
Copyright (C) 1999-2014 by Shigeru Chiba.
Java(TM) is a trademark of Sun Microsystems, Inc.