211 * </dd> 212 * </dl> 213 * 214 * @author Peter von der Ahé 215 * @author Jonathan Gibbons 216 * @see DiagnosticListener 217 * @see Diagnostic 218 * @see JavaFileManager 219 * @since 1.6 220 */ 221 public interface JavaCompiler extends Tool, OptionChecker { 222 223 /** 224 * Creates a future for a compilation task with the given 225 * components and arguments. The compilation might not have 226 * completed as described in the CompilationTask interface. 227 * 228 * <p>If a file manager is provided, it must be able to handle all 229 * locations defined in {@link StandardLocation}. 230 * 231 * @param out a Writer for additional output from the compiler; 232 * use {@code System.err} if {@code null} 233 * @param fileManager a file manager; if {@code null} use the 234 * compiler's standard filemanager 235 * @param diagnosticListener a diagnostic listener; if {@code 236 * null} use the compiler's default method for reporting 237 * diagnostics 238 * @param options compiler options, {@code null} means no options 239 * @param classes class names (for annotation processing), {@code 240 * null} means no class names 241 * @param compilationUnits the compilation units to compile, {@code 242 * null} means no compilation units 243 * @return an object representing the compilation 244 * @throws RuntimeException if an unrecoverable error 245 * occurred in a user supplied component. The 246 * {@linkplain Throwable#getCause() cause} will be the error in 247 * user code. 248 * @throws IllegalArgumentException if any of the given 249 * compilation units are of other kind than 250 * {@linkplain JavaFileObject.Kind#SOURCE source} 251 */ 252 CompilationTask getTask(Writer out, 253 JavaFileManager fileManager, 254 DiagnosticListener<? super JavaFileObject> diagnosticListener, 255 Iterable<String> options, 256 Iterable<String> classes, 257 Iterable<? extends JavaFileObject> compilationUnits); 258 259 /** 260 * Gets a new instance of the standard file manager implementation | 211 * </dd> 212 * </dl> 213 * 214 * @author Peter von der Ahé 215 * @author Jonathan Gibbons 216 * @see DiagnosticListener 217 * @see Diagnostic 218 * @see JavaFileManager 219 * @since 1.6 220 */ 221 public interface JavaCompiler extends Tool, OptionChecker { 222 223 /** 224 * Creates a future for a compilation task with the given 225 * components and arguments. The compilation might not have 226 * completed as described in the CompilationTask interface. 227 * 228 * <p>If a file manager is provided, it must be able to handle all 229 * locations defined in {@link StandardLocation}. 230 * 231 * <p>Note that annotation processing can process both the 232 * compilation units of source code to be compiled, passed with 233 * the {@code compilationUnits} parameter, as well as class 234 * files, whose names are passed with the {@code classes} 235 * parameter. 236 * 237 * @param out a Writer for additional output from the compiler; 238 * use {@code System.err} if {@code null} 239 * @param fileManager a file manager; if {@code null} use the 240 * compiler's standard filemanager 241 * @param diagnosticListener a diagnostic listener; if {@code 242 * null} use the compiler's default method for reporting 243 * diagnostics 244 * @param options compiler options, {@code null} means no options 245 * @param classes names of classes to be processed by annotation 246 * processing, {@code null} means no class names 247 * @param compilationUnits the compilation units to compile, {@code 248 * null} means no compilation units 249 * @return an object representing the compilation 250 * @throws RuntimeException if an unrecoverable error 251 * occurred in a user supplied component. The 252 * {@linkplain Throwable#getCause() cause} will be the error in 253 * user code. 254 * @throws IllegalArgumentException if any of the given 255 * compilation units are of other kind than 256 * {@linkplain JavaFileObject.Kind#SOURCE source} 257 */ 258 CompilationTask getTask(Writer out, 259 JavaFileManager fileManager, 260 DiagnosticListener<? super JavaFileObject> diagnosticListener, 261 Iterable<String> options, 262 Iterable<String> classes, 263 Iterable<? extends JavaFileObject> compilationUnits); 264 265 /** 266 * Gets a new instance of the standard file manager implementation |