Class CompilerApiExamples
java.lang.Object
net.jrodolfo.java_evolution.java06.compiler_api.CompilerApiExamples
Demonstrates the Java 6 Compiler API with real source files and structured
diagnostics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImmutable result returned by a compiler invocation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompiles Java source files into a class-output directory.booleanChecks whether the current runtime image provides the standard system compiler.
-
Constructor Details
-
CompilerApiExamples
public CompilerApiExamples()
-
-
Method Details
-
systemCompilerIsAvailable
public boolean systemCompilerIsAvailable()Checks whether the current runtime image provides the standard system compiler.- Returns:
truewhenToolProvider.getSystemJavaCompiler()can locate a compiler
-
compile
public CompilerApiExamples.CompilationResult compile(List<File> sourceFiles, File outputDirectory) throws IOException Compiles Java source files into a class-output directory.- Parameters:
sourceFiles- Java source files to compileoutputDirectory- directory where generated.classfiles should be written- Returns:
- the compilation outcome and collected diagnostics
- Throws:
IOException- when the file manager cannot access the supplied filesIllegalStateException- when the code is running without a system compiler
-