202 @Override @DefinedBy(Api.COMPILER)
203 public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) {
204 if (err == null)
205 err = System.err;
206 for (String argument : arguments)
207 Objects.requireNonNull(argument);
208 return com.sun.tools.javac.Main.compile(arguments, new PrintWriter(err, true));
209 }
210
211 @Override @DefinedBy(Api.COMPILER)
212 public Set<SourceVersion> getSourceVersions() {
213 return Collections.unmodifiableSet(EnumSet.range(SourceVersion.RELEASE_3,
214 SourceVersion.latest()));
215 }
216
217 @Override @DefinedBy(Api.COMPILER)
218 public int isSupportedOption(String option) {
219 Set<Option> recognizedOptions = Option.getJavacToolOptions();
220 for (Option o : recognizedOptions) {
221 if (o.matches(option)) {
222 return o.hasArg() ? 1 : 0;
223 }
224 }
225 return -1;
226 }
227
228 }
|
202 @Override @DefinedBy(Api.COMPILER)
203 public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) {
204 if (err == null)
205 err = System.err;
206 for (String argument : arguments)
207 Objects.requireNonNull(argument);
208 return com.sun.tools.javac.Main.compile(arguments, new PrintWriter(err, true));
209 }
210
211 @Override @DefinedBy(Api.COMPILER)
212 public Set<SourceVersion> getSourceVersions() {
213 return Collections.unmodifiableSet(EnumSet.range(SourceVersion.RELEASE_3,
214 SourceVersion.latest()));
215 }
216
217 @Override @DefinedBy(Api.COMPILER)
218 public int isSupportedOption(String option) {
219 Set<Option> recognizedOptions = Option.getJavacToolOptions();
220 for (Option o : recognizedOptions) {
221 if (o.matches(option)) {
222 return o.hasSeparateArg() ? 1 : 0;
223 }
224 }
225 return -1;
226 }
227
228 }
|