Class CodeGenerator

java.lang.Object
io.quarkus.deployment.CodeGenerator

public class CodeGenerator extends Object
A set of methods to initialize and execute CodeGenProviders.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    dumpCurrentConfigValues(io.quarkus.bootstrap.model.ApplicationModel appModel, String launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader, Properties previouslyRecordedProperties, Path outputFile)
    Initializes an application build time configuration and dumps current values of properties passed in as previouslyRecordedProperties to a file.
    static org.eclipse.microprofile.config.Config
    getConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, io.quarkus.runtime.LaunchMode launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader)
     
    init(io.quarkus.bootstrap.model.ApplicationModel model, Map<String,String> properties, ClassLoader deploymentClassLoader, Collection<DevModeContext.ModuleInfo> modules)
     
    static void
    initAndRun(io.quarkus.bootstrap.classloading.QuarkusClassLoader classLoader, io.quarkus.paths.PathCollection sourceParentDirs, Path generatedSourcesDir, Path buildDir, Consumer<Path> sourceRegistrar, io.quarkus.bootstrap.model.ApplicationModel appModel, Properties properties, String launchMode, boolean test)
     
    static <T> T
    readConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, io.quarkus.runtime.LaunchMode launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader, Function<BuildTimeConfigurationReader,T> function)
     
    static boolean
    trigger(ClassLoader deploymentClassLoader, CodeGenData data, io.quarkus.bootstrap.model.ApplicationModel appModel, org.eclipse.microprofile.config.Config config, boolean test)
    generate sources for given code gen

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CodeGenerator

      public CodeGenerator()
  • Method Details

    • initAndRun

      public static void initAndRun(io.quarkus.bootstrap.classloading.QuarkusClassLoader classLoader, io.quarkus.paths.PathCollection sourceParentDirs, Path generatedSourcesDir, Path buildDir, Consumer<Path> sourceRegistrar, io.quarkus.bootstrap.model.ApplicationModel appModel, Properties properties, String launchMode, boolean test) throws io.quarkus.bootstrap.prebuild.CodeGenException
      Throws:
      io.quarkus.bootstrap.prebuild.CodeGenException
    • init

      public static List<CodeGenData> init(io.quarkus.bootstrap.model.ApplicationModel model, Map<String,String> properties, ClassLoader deploymentClassLoader, Collection<DevModeContext.ModuleInfo> modules) throws io.quarkus.bootstrap.prebuild.CodeGenException
      Throws:
      io.quarkus.bootstrap.prebuild.CodeGenException
    • trigger

      public static boolean trigger(ClassLoader deploymentClassLoader, CodeGenData data, io.quarkus.bootstrap.model.ApplicationModel appModel, org.eclipse.microprofile.config.Config config, boolean test) throws io.quarkus.bootstrap.prebuild.CodeGenException
      generate sources for given code gen
      Parameters:
      deploymentClassLoader - deployment classloader
      data - code gen
      appModel - app model
      config - config instance
      test - whether the sources are generated for production code or tests
      Returns:
      true if sources have been created
      Throws:
      io.quarkus.bootstrap.prebuild.CodeGenException - on failure
    • dumpCurrentConfigValues

      public static void dumpCurrentConfigValues(io.quarkus.bootstrap.model.ApplicationModel appModel, String launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader, Properties previouslyRecordedProperties, Path outputFile)
      Initializes an application build time configuration and dumps current values of properties passed in as previouslyRecordedProperties to a file.
      Parameters:
      appModel - application model
      launchMode - launch mode
      buildSystemProps - build system (or project) properties
      deploymentClassLoader - build classloader
      previouslyRecordedProperties - properties to read from the initialized configuration
      outputFile - output file
    • getConfig

      public static org.eclipse.microprofile.config.Config getConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, io.quarkus.runtime.LaunchMode launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader) throws io.quarkus.bootstrap.prebuild.CodeGenException
      Throws:
      io.quarkus.bootstrap.prebuild.CodeGenException
    • readConfig

      public static <T> T readConfig(io.quarkus.bootstrap.model.ApplicationModel appModel, io.quarkus.runtime.LaunchMode launchMode, Properties buildSystemProps, io.quarkus.bootstrap.classloading.QuarkusClassLoader deploymentClassLoader, Function<BuildTimeConfigurationReader,T> function) throws io.quarkus.bootstrap.prebuild.CodeGenException
      Throws:
      io.quarkus.bootstrap.prebuild.CodeGenException