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 Summary
ConstructorsConstructorDescriptionConstruct a new simple module loader strategy with dynamic compilation disabled.Construct a new simple module loader strategy with the provided binding generator. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<? extends IBoundModule>handleUnboundModule(IModule module) Handle a module that is not already bound to a Java class.Methods inherited from class dev.metaschema.databind.AbstractModuleLoaderStrategy
getBindingMatchers, getBoundDefinitionForClass, loadModule, lookupInstance, registerBindingMatcher, registerModuleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.databind.IBindingContext.IModuleLoaderStrategy
postProcessModule
-
Constructor Details
-
SimpleModuleLoaderStrategy
public 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(IModule module) throws MetaschemaException Description copied from class:AbstractModuleLoaderStrategyHandle 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:
handleUnboundModulein classAbstractModuleLoaderStrategy- Parameters:
module- the unbound module to handle- Returns:
- the class of the bound module to use
- Throws:
MetaschemaException- if an error occurs while determining the bound module class
-