Class DefaultModuleBindingGenerator

java.lang.Object
dev.metaschema.databind.codegen.DefaultModuleBindingGenerator
All Implemented Interfaces:
IModuleBindingGenerator

Default implementation of IModuleBindingGenerator that generates and compiles Java classes for a Metaschema module.

This generator creates Java source files representing the module and its definitions, compiles them, and loads the resulting classes using a custom class loader.

  • Constructor Details

    • DefaultModuleBindingGenerator

      public DefaultModuleBindingGenerator(@NonNull Path compilePath)
      Construct a new binding generator that generates classes in the specified directory.
      Parameters:
      compilePath - the directory where generated Java classes will be created and compiled
  • Method Details

    • generate

      public Class<? extends IBoundModule> generate(dev.metaschema.core.model.IModule module) throws dev.metaschema.core.model.MetaschemaException
      Description copied from interface: IModuleBindingGenerator
      Generate bound Java classes for the provided Metaschema module.
      Specified by:
      generate in interface IModuleBindingGenerator
      Parameters:
      module - the Metaschema module to generate classes for
      Returns:
      the generated bound module class
      Throws:
      dev.metaschema.core.model.MetaschemaException - if an error occurs during generation or compilation