JTransformer is a query and transformation engine for Java source code, available as a plug-in for the Eclipse JDT. It offers:
- Full Java AST. JTransformer creates an Abstract Syntax Tree (AST) representation of the full source code of a Java project (even of comments!). Class files referenced by source code are represented too, except for initializers and method bodies. (Executable code from class files is not decompiled, only the symbol table information is extracted.)
- Java 1.6. Java 1.6 is fully supported (including generics, annotations, foreach, …) since JTransformer 3.0.
- Logic-based AST representation and analysis. The Java AST is represented internally as a Prolog database, making it easy to express powerful analyses and to build abstract views of the program in just a few lines of code. Analyses can be performed on the entire AST, including parts representing class files.
- Logic-based transformations. Using Conditional Transformations (CTs) programmers can quickly feed their analyses results into powerful transformations of the logic fact base. Only source code can be transformed.
- Bidirectional synchronization. JTransformer synchronizes the logical AST representation with Java source code upon changes on either side. Source code changes are propagated automatically and incrementally to the logic based representation. Transformations of the logic based representation can be propagated to the source code upon explicit request.
- Multi-project workspaces. Analysis and transformations across multiple projects is as easy as in a single project. The only limitation is that the projects must not contain define different versions of the same fully qualified type name.
- Incomplete projects. JTransformer can also handle incomplete projects, making it easy to analyse parts of large projects in isolation, without some of their dependencies.
Since 2004 JTransfomer has gradually been extended to a language-independent model analysis and transformation engine, StarTransfomer. Some of the new features are already available in the language-independent API.