Class SimpleModuleLoaderStrategy

java.lang.Object
dev.metaschema.databind.AbstractModuleLoaderStrategy
dev.metaschema.databind.SimpleModuleLoaderStrategy
All Implemented Interfaces:
IBindingContext.IModuleLoaderStrategy, ModuleLoadingPostProcessor

A simple module loader strategy that supports optional dynamic code generation.

By default, dynamic compilation is disabled. To enable dynamic compilation of Metaschema modules into bound Java classes, provide an IModuleBindingGenerator implementation to the constructor.

Since:
2.0.0
  • Constructor Details

    • SimpleModuleLoaderStrategy

      Construct a new simple module loader strategy with dynamic compilation disabled.
    • SimpleModuleLoaderStrategy

      Construct a new simple module loader strategy with the provided binding generator.
      Parameters:
      generator - the generator to use for dynamic module compilation
  • Method Details

    • handleUnboundModule

      protected Class<? extends IBoundModule> handleUnboundModule(dev.metaschema.core.model.IModule module) throws dev.metaschema.core.model.MetaschemaException
      Description copied from class: AbstractModuleLoaderStrategy
      Handle a module that is not already bound to a Java class.

      This method is called when a module is encountered that does not implement IBoundModule. Implementations must determine the appropriate bound module class to use for the given module.

      Specified by:
      handleUnboundModule in class AbstractModuleLoaderStrategy
      Parameters:
      module - the unbound module to handle
      Returns:
      the class of the bound module to use
      Throws:
      dev.metaschema.core.model.MetaschemaException - if an error occurs while determining the bound module class