接口 | 描述 |
---|---|
Diagnostic<S> |
工具诊断界面。
|
DiagnosticListener<S> |
用于从工具接收诊断的接口。
|
DocumentationTool |
从程序中调用Java编程语言文档工具的接口。
|
DocumentationTool.DocumentationTask |
表示文档任务的未来的接口。
|
FileObject |
文件抽象的工具。
|
JavaCompiler |
从程序中调用Java编程语言编译器的接口。
|
JavaCompiler.CompilationTask |
代表编译任务的未来的接口。
|
JavaFileManager |
用于Java编程语言源和类文件的工具的文件管理器。
|
JavaFileManager.Location |
文件对象的位置接口。
|
JavaFileObject |
用于Java编程语言源和类文件的工具的文件抽象。
|
OptionChecker |
用于识别选项的界面。
|
StandardJavaFileManager |
文件管理器基于java.io.File 。
|
Tool |
可以从程序调用的工具的通用界面。
|
类 | 描述 |
---|---|
DiagnosticCollector<S> |
提供在列表中收集诊断的简单方法。
|
ForwardingFileObject<F extends FileObject> |
转发给定文件对象。
|
ForwardingJavaFileManager<M extends JavaFileManager> |
转发给给定的文件管理器。
|
ForwardingJavaFileObject<F extends JavaFileObject> |
转发给定文件对象。
|
SimpleJavaFileObject |
为JavaFileObject中的大多数方法提供简单的实现。
|
ToolProvider |
提供定位工具提供者的方法,例如编译器的提供者。
|
Enum | 描述 |
---|---|
Diagnostic.Kind |
诊断的种类,例如错误或警告。
|
DocumentationTool.Location |
特定于 DocumentationTool 的地点 。
|
JavaFileObject.Kind |
种类的JavaFileObjects。
|
StandardLocation |
文件对象的标准位置。
|
These interfaces and classes are required as part of the Java™ Platform, Standard Edition (Java SE), but there is no requirement to provide any tools implementing them.
Unless explicitly allowed, all methods in this package might throw a NullPointerException if given a null
argument or if given a list or collection containing null
elements. Similarly, no method may return null
unless explicitly allowed.
This package is the home of the Java programming language compiler framework. This framework allows clients of the framework to locate and run compilers from programs. The framework also provides Service Provider Interfaces (SPI) for structured access to diagnostics (DiagnosticListener) as well as a file abstraction for overriding file access (JavaFileManager and JavaFileObject). See JavaCompiler for more details on using the SPI.
There is no requirement for a compiler at runtime. However, if a default compiler is provided, it can be located using the ToolProvider, for example:
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
It is possible to provide alternative compilers or tools through the service provider mechanism.
For example, if com.vendor.VendorJavaCompiler
is a provider of the JavaCompiler
tool then its jar file would contain the file META-INF/services/javax.tools.JavaCompiler
. This file would contain the single line:
com.vendor.VendorJavaCompiler
If the jar file is on the class path, VendorJavaCompiler can be located using code like this:
JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.