36 *
37 * @since 1.8
38 */
39 public interface DocumentationTool extends Tool, OptionChecker {
40 /**
41 * Creates a future for a documentation task with the given
42 * components and arguments. The task might not have
43 * completed as described in the DocumentationTask interface.
44 *
45 * <p>If a file manager is provided, it must be able to handle all
46 * locations defined in {@link DocumentationTool.Location},
47 * as well as
48 * {@link StandardLocation#SOURCE_PATH},
49 * {@link StandardLocation#CLASS_PATH}, and
50 * {@link StandardLocation#PLATFORM_CLASS_PATH}.
51 *
52 * @param out a Writer for additional output from the tool;
53 * use {@code System.err} if {@code null}
54 *
55 * @param fileManager a file manager; if {@code null} use the
56 * tool's standard filemanager
57 *
58 * @param diagnosticListener a diagnostic listener; if {@code null}
59 * use the tool's default method for reporting diagnostics
60 *
61 * @param docletClass a class providing the necessary methods required
62 * of a doclet; a value of {@code null} means to use the standard doclet.
63 *
64 * @param options documentation tool options and doclet options,
65 * {@code null} means no options
66 *
67 * @param compilationUnits the compilation units to compile, {@code
68 * null} means no compilation units
69 *
70 * @return an object representing the compilation
71 *
72 * @throws RuntimeException if an unrecoverable error
73 * occurred in a user supplied component. The
74 * {@linkplain Throwable#getCause() cause} will be the error in
75 * user code.
76 *
96 * The standard file manager must be usable with other tools.
97 *
98 * @param diagnosticListener a diagnostic listener for non-fatal
99 * diagnostics; if {@code null} use the compiler's default method
100 * for reporting diagnostics
101 *
102 * @param locale the locale to apply when formatting diagnostics;
103 * {@code null} means the {@linkplain Locale#getDefault() default locale}.
104 *
105 * @param charset the character set used for decoding bytes; if
106 * {@code null} use the platform default
107 *
108 * @return the standard file manager
109 */
110 StandardJavaFileManager getStandardFileManager(
111 DiagnosticListener<? super JavaFileObject> diagnosticListener,
112 Locale locale,
113 Charset charset);
114
115 /**
116 * Interface representing a future for a documentation task. The
117 * task has not yet started. To start the task, call
118 * the {@linkplain #call call} method.
119 *
120 * <p>Before calling the call method, additional aspects of the
121 * task can be configured, for example, by calling the
122 * {@linkplain #setLocale setLocale} method.
123 */
124 interface DocumentationTask extends Callable<Boolean> {
125 /**
126 * Adds root modules to be taken into account during module
127 * resolution.
128 * Invalid module names may cause either
129 * {@code IllegalArgumentException} to be thrown,
130 * or diagnostics to be reported when the task is started.
131 * @param moduleNames the names of the root modules
132 * @throws IllegalArgumentException may be thrown for some
133 * invalid module names
134 * @throws IllegalStateException if the task has started
135 * @since 9
136 */
137 void addModules(Iterable<String> moduleNames);
138
139 /**
140 * Sets the locale to be applied when formatting diagnostics and
|
36 *
37 * @since 1.8
38 */
39 public interface DocumentationTool extends Tool, OptionChecker {
40 /**
41 * Creates a future for a documentation task with the given
42 * components and arguments. The task might not have
43 * completed as described in the DocumentationTask interface.
44 *
45 * <p>If a file manager is provided, it must be able to handle all
46 * locations defined in {@link DocumentationTool.Location},
47 * as well as
48 * {@link StandardLocation#SOURCE_PATH},
49 * {@link StandardLocation#CLASS_PATH}, and
50 * {@link StandardLocation#PLATFORM_CLASS_PATH}.
51 *
52 * @param out a Writer for additional output from the tool;
53 * use {@code System.err} if {@code null}
54 *
55 * @param fileManager a file manager; if {@code null} use the
56 * tool's standard file manager
57 *
58 * @param diagnosticListener a diagnostic listener; if {@code null}
59 * use the tool's default method for reporting diagnostics
60 *
61 * @param docletClass a class providing the necessary methods required
62 * of a doclet; a value of {@code null} means to use the standard doclet.
63 *
64 * @param options documentation tool options and doclet options,
65 * {@code null} means no options
66 *
67 * @param compilationUnits the compilation units to compile, {@code
68 * null} means no compilation units
69 *
70 * @return an object representing the compilation
71 *
72 * @throws RuntimeException if an unrecoverable error
73 * occurred in a user supplied component. The
74 * {@linkplain Throwable#getCause() cause} will be the error in
75 * user code.
76 *
96 * The standard file manager must be usable with other tools.
97 *
98 * @param diagnosticListener a diagnostic listener for non-fatal
99 * diagnostics; if {@code null} use the compiler's default method
100 * for reporting diagnostics
101 *
102 * @param locale the locale to apply when formatting diagnostics;
103 * {@code null} means the {@linkplain Locale#getDefault() default locale}.
104 *
105 * @param charset the character set used for decoding bytes; if
106 * {@code null} use the platform default
107 *
108 * @return the standard file manager
109 */
110 StandardJavaFileManager getStandardFileManager(
111 DiagnosticListener<? super JavaFileObject> diagnosticListener,
112 Locale locale,
113 Charset charset);
114
115 /**
116 * Interface representing a future for a documentation task.
117 * To start the task, call the {@linkplain #call call} method.
118 *
119 * <p>Before calling the {@code call} method, additional aspects of the
120 * task can be configured, for example, by calling the
121 * {@linkplain #setLocale setLocale} method.
122 */
123 interface DocumentationTask extends Callable<Boolean> {
124 /**
125 * Adds root modules to be taken into account during module
126 * resolution.
127 * Invalid module names may cause either
128 * {@code IllegalArgumentException} to be thrown,
129 * or diagnostics to be reported when the task is started.
130 * @param moduleNames the names of the root modules
131 * @throws IllegalArgumentException may be thrown for some
132 * invalid module names
133 * @throws IllegalStateException if the task has started
134 * @since 9
135 */
136 void addModules(Iterable<String> moduleNames);
137
138 /**
139 * Sets the locale to be applied when formatting diagnostics and
|