Tips and tricks for using JiBX
start > issues-2.0 > binding-compiler

binding-compiler

Created by dsosnoski. Last edited by dsosnoski, one year and 106 days ago. Viewed 1,940 times. #2
The current binding compiler code is based on the Apache BCEL library, which is both overly bulky and somewhat awkward to use. JiBX 2.0 will use the ASM library instead for all bytecode work. JiBX 2.0 will also support source code enhancement as an alternative to bytecode enhancement. Ideally, it should support using separate classes wherever possible (meaning that the original source or class files are left unchanged as long as the user is working with externally-accessible methods or fields).

Source code generation and enhancement is being implemented using the Eclipse AST. This isn't ideal, mainly because if you work within the Eclipse framework translating an AST to source code is computationally expensive (because it wants to do everything as edits). But it should be possible to avoid this overhead by writing a visitor that just spits out source code directly when running outside Eclipse, and the edits capability is nice to have for integration with Eclipse. On the bright side, the Eclipse AST has decent support for the Java 5 (AKA Java++) language features, and works well with JavaDocs.

For 2.0 the binding compiler will always generate an AST. A visitor will be used to generate bytecode from an AST for when the user wants JiBX 1.x-style bytecode enhancement.

no comments
snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt