Interface DocumentationTool
- All Superinterfaces:
OptionChecker, Tool
Interface to invoke Java programming language documentation tools from
programs.
- Since:
- 1.8
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface representing a future for a documentation task.static enum
Locations specific toDocumentationTool
. -
Method Summary
Modifier and TypeMethodDescriptiongetStandardFileManager
(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) Returns a new instance of the standard file manager implementation for this tool.getTask
(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Class<?> docletClass, Iterable<String> options, Iterable<? extends JavaFileObject> compilationUnits) Creates a future for a documentation task with the given components and arguments.Methods declared in interface OptionChecker
isSupportedOption
Modifier and TypeMethodDescriptionint
isSupportedOption
(String option) Determines if the given option is supported and if so, the number of arguments the option takes.Methods declared in interface Tool
getSourceVersions, name, run
Modifier and TypeMethodDescriptionReturns the source versions of the Java programming language supported by this tool.default String
name()
Returns the name of this tool, or an empty string if no name is provided.int
run
(InputStream in, OutputStream out, OutputStream err, String... arguments) Run the tool with the given I/O channels and arguments.
-
Method Details
-
getTask
DocumentationTool.DocumentationTask getTask(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Class<?> docletClass, Iterable<String> options, Iterable<? extends JavaFileObject> compilationUnits) Creates a future for a documentation task with the given components and arguments. The task might not have completed as described in the DocumentationTask interface.If a file manager is provided, it must be able to handle all locations defined in
DocumentationTool.Location
, as well asStandardLocation.SOURCE_PATH
,StandardLocation.CLASS_PATH
, andStandardLocation.PLATFORM_CLASS_PATH
.- Parameters:
out
- a Writer for additional output from the tool; useSystem.err
ifnull
fileManager
- a file manager; ifnull
use the tool's standard file managerdiagnosticListener
- a diagnostic listener; ifnull
use the tool's default method for reporting diagnosticsdocletClass
- a class providing the necessary methods required of a doclet; a value ofnull
means to use the standard doclet.options
- documentation tool options and doclet options,null
means no optionscompilationUnits
- the compilation units to compile,null
means no compilation units- Returns:
- an object representing the compilation
- Throws:
RuntimeException
- if an unrecoverable error occurred in a user supplied component. The cause will be the error in user code.IllegalArgumentException
- if any of the given compilation units are of other kind than source
-
getStandardFileManager
StandardJavaFileManager getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) Returns a new instance of the standard file manager implementation for this tool. The file manager will use the given diagnostic listener for producing any non-fatal diagnostics. Fatal errors will be signaled with the appropriate exceptions.The standard file manager will be automatically reopened if it is accessed after calls to
flush
orclose
. The standard file manager must be usable with other tools.- Parameters:
diagnosticListener
- a diagnostic listener for non-fatal diagnostics; ifnull
use the compiler's default method for reporting diagnosticslocale
- the locale to apply when formatting diagnostics;null
means the default locale.charset
- the character set used for decoding bytes; ifnull
use the platform default- Returns:
- the standard file manager
-