Interface CompilationResult

  • @ProviderType
    public interface CompilationResult
    The compilation result allows clients of the java compiler to check for error messages, warnings (if not disabled by the options) and allows to access the compiled classes.
    • Method Detail

      • getErrors

        java.util.List<CompilerMessage> getErrors()
        Return a list of error messages that occured during compilation. If no errors occured null is returned.
        A list of error messages or null.
      • getWarnings

        java.util.List<CompilerMessage> getWarnings()
        Return a list of warnings that occured during compilation. If no warnings occured null is returned.
        A list of warnings or null.
      • didCompile

        boolean didCompile()
        Was a compilation required or were all classes recent?
        true if classes were compiled.
      • loadCompiledClass

        java.lang.Class<?> loadCompiledClass​(java.lang.String className)
                                      throws java.lang.ClassNotFoundException
        Try to load the compiled class. The class loading might fail if the className is not one of the compiled sources, if the compilation failed or if a class loader writer has been used in combination with a class loader that is not able to load the classes written by the class loader writer.
        className - The class name of the compiled class.
        The compiled class
        java.lang.ClassNotFoundException - If the class could not be found or compilation failed.