views:

233

answers:

2

As far as I can tell, Java has no such equivalent of C#'s Reflection.Emit stuff. Are there any additional libraries for Java that provide similar functionality? What are the differences (to reflection emit)?

+4  A: 

The Byte Code Engineering Library (BCEL)

Darin Dimitrov
Does BCEL allow the emitted bytecode to be run at runtime (as opposed to saving it to a file)?
+3  A: 

Besides Darin's excellent answer (+1), ASM is worth checking out too.

Chris Jester-Young
After investigating it seems ASM is the best fit for me. I also came across some stuff that compared it favourably with regard to performance. Thanks!