By templedf on Apr 06, 2007
Looks like Tom has done a bunch of work to update Jackpot for the new Java Source API in NetBeans 6.0. Because he more or less started over from scratch, the API has changed a bit. Examples are posted at the 6.0 Development Update Center.
If you're not familiar with Jackpot, it's an exceedingly powerful way to transform source files. Think of it as XSL for programmers. Using Jackpot, one can write queries that examine source files, such as looking for unused variables or counting occurances of
if statements without
else blocks, or transformations that walk through source files and make changes, like adding Logger.entering() and Logger.exiting() calls to every method or changing Iterator.hasNext() loops into for-each loops. Jackpot queries and transformation can either be driven by rules files or programs written to the Jackpot API. Rules files are certainly simpler than writing to the API, but they are also more restricted in the kinds of queries and transforms they enable. The Jackpot API certainly has a learning curve, but it gives the developer the ability to examine every little detail of a source file and do transforms that are arbitrarily complex. If you haven't looked at Jackpot, grab a copy of NetBeans and give it a whirl!