主旨

The JavaTM Compiler API is a set of interfaces that describes the functions provided by a JavaTM Language Compiler, and a service provider framework so vendors can provide implementations of these interfaces.

The interfaces abstract the way a compiler interacts with its environment. While the existing command-line versions of compiler receive their inputs from the file systems and deposit their outputs there, reporting errors in a single output stream, the new compiler API will allow a compiler to interact with an abstraction of the file system. This abstraction will likely be provided by an extension of the NIO facilities in Tiger (1.5), and allow users to provide source and class files (and paths) to the compiler in the file system, in jar files, or in memory, and allowing the compiler to deposit its output similarly. Diagnostics will be returned from a compiler as structured data, with both pre- and post-localization messages available.

In addition, the new API should provide a facility for a compiler to report dependency information among compilation units. Such information can assist an integrated development environment in reducing the scope of future recompilations.

Future versions of this API might expose more of the structure of the program, for example the declaration structure of the program (ala the javadoc API), program annotations (JSR 175) or even the code itself (ASTs: Abstract Sytntax Trees). These are not goals of the initial version of this specifications.