JavacTaskImpl task = (JavacTaskImpl) tool.getTask( CharStreams.nullWriter(), fileManager,
.getTask( CharStreams.nullWriter(), state.context.get(JavaFileManager.class),
BasicJavacTask task = (BasicJavacTask)_javacTool.getTask( errors, _fm, null, Arrays.asList( "-proc:none", "-source", "1.8", "-Xprefer:source" ), null, null ); if( errors.getBuffer().length() > 0 ) BasicJavacTask task = (BasicJavacTask)_javacTool.getTask( errors, _wfm, null, Arrays.asList( "-proc:none", "-source", "1.8", "-Xprefer:source" ), null, null ); if( errors.getBuffer().length() > 0 )
JavacTask task = ((JavacTool) compiler) .getTask(
JavacTask task = ((JavacTool) compiler) .getTask(
InMemoryJavaFileManager fileManager = new InMemoryJavaFileManager( compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8)); JavacTask task = ((JavacTool) compiler).getTask(
JavacTaskImpl task = (JavacTaskImpl)JavacTool.create().getTask(null, ClasspathInfoAccessor.getINSTANCE().createFileManager(cpInfo), diagnosticListener, options, null, Collections.<JavaFileObject>emptySet(),
public JavacTask getTask(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Iterable<String> options, Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits, Context context) { try { ClientCodeWrapper ccw = ClientCodeWrapper.instance(context); if (options != null) for (String option : options) option.getClass(); // null check if (classes != null) { for (String cls : classes) if (!SourceVersion.isName(cls)) // implicit null check throw new IllegalArgumentException("Not a valid class name: " + cls); } if (compilationUnits != null) { compilationUnits = ccw.wrapJavaFileObjects(compilationUnits); // implicit null check for (JavaFileObject cu : compilationUnits) { if (cu.getKind() != JavaFileObject.Kind.SOURCE) { String kindMsg = "Compilation unit is not of SOURCE kind: " + "\"" + cu.getName() + "\""; throw new IllegalArgumentException(kindMsg); } } }
public JavacTask getTask(Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Iterable<String> options, Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits, Context context) { try { ClientCodeWrapper ccw = ClientCodeWrapper.instance(context); if (options != null) for (String option : options) option.getClass(); // null check if (classes != null) { for (String cls : classes) if (!SourceVersion.isName(cls)) // implicit null check throw new IllegalArgumentException("Not a valid class name: " + cls); } if (compilationUnits != null) { compilationUnits = ccw.wrapJavaFileObjects(compilationUnits); // implicit null check for (JavaFileObject cu : compilationUnits) { if (cu.getKind() != JavaFileObject.Kind.SOURCE) { String kindMsg = "Compilation unit is not of SOURCE kind: " + "\"" + cu.getName() + "\""; throw new IllegalArgumentException(kindMsg); } } }
JavacTask newTask = JavacTool.create() .getTask( CharStreams.nullWriter(), state.context.get(JavaFileManager.class),
fm.setLocation(StandardLocation.SOURCE_PATH, javacSourcePath); JavacTask task = tool.getTask(out, fm, null, javacOpts, null, fm.getJavaFileObjectsFromFiles(javacFiles)); Iterable<? extends CompilationUnitTree> units = task.parse();
fm.setLocation(StandardLocation.SOURCE_PATH, javacSourcePath); JavacTask task = tool.getTask(out, fm, null, javacOpts, null, fm.getJavaFileObjectsFromFiles(javacFiles)); Iterable<? extends CompilationUnitTree> units = task.parse();