Class GeneratedSourceCompilerImpl

java.lang.Object
com.graphql_java_generator.plugin.test.compiler.GeneratedSourceCompilerImpl
All Implemented Interfaces:
GeneratedSourceCompiler

public class GeneratedSourceCompilerImpl extends Object implements GeneratedSourceCompiler
This class allows to compile a given source code.
Author:
etienne-sf
  • Constructor Details

    • GeneratedSourceCompilerImpl

      public GeneratedSourceCompilerImpl(org.slf4j.Logger log, String className, File javaSrcFolder, File classTargetFolder, String classpath, Charset javaFileCharset)
      Parameters:
      log -
      className - The full classname, that is: with the package (e.g.: java.io.File)
      javaSrcFolder -
      classTargetFolder -
      classpath - If null, the current classpath is used.
      javaFileCharset - The Charset (like UTF-8...) to use to store the java source file.
  • Method Details

    • compileAllSources

      public boolean compileAllSources()
      Compile all sources stored in the root source folder for the instance.
      Specified by:
      compileAllSources in interface GeneratedSourceCompiler
      Returns:
      true if the compilation was Ok (without errors)
    • compileOneSource

      public boolean compileOneSource()
      Compiles the java file.
      Specified by:
      compileOneSource in interface GeneratedSourceCompiler
      Returns:
      true if the compilation was Ok (without errors)
    • compileGivenSource

      public boolean compileGivenSource(String javaSource)
      This stores the given source code into the java file, then compiles it. The source file comes from the instance parameters.
      Specified by:
      compileGivenSource in interface GeneratedSourceCompiler
      Returns:
      true if the compilation was Ok (without errors)
      See Also:
      • org.wsutils.servergeneration.portimpl.compiler.GeneratedSourceCompiler#compile(java.lang.String)