Class PostProcessingModuleLoaderStrategy
java.lang.Object
gov.nist.secauto.metaschema.databind.PostProcessingModuleLoaderStrategy
- All Implemented Interfaces:
IBindingContext.IModuleLoaderStrategy,ModuleLoadingPostProcessor
public class PostProcessingModuleLoaderStrategy
extends Object
implements IBindingContext.IModuleLoaderStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionPostProcessingModuleLoaderStrategy(List<IModuleLoader.IModulePostProcessor> modulePostProcessors) PostProcessingModuleLoaderStrategy(List<IModuleLoader.IModulePostProcessor> modulePostProcessors, IBindingContext.IModuleLoaderStrategy delegate) -
Method Summary
Modifier and TypeMethodDescriptionGet the matchers used to identify the bound class associated with the definition's root name.getBoundDefinitionForClass(Class<? extends IBoundObject> clazz, IBindingContext bindingContext) Get theIBoundDefinitionModelinstance associated with the provided Java class.protected List<IModuleLoader.IModulePostProcessor>loadModule(Class<? extends IBoundModule> clazz, IBindingContext bindingContext) Load the bound Metaschema module represented by the provided class.voidpostProcessModule(IModule module, IBindingContext bindingContext) Perform post-processing on the module.protected voidprocessModule(IModule module) Perform post-processing on the provided module.registerModule(IModule module, IBindingContext bindingContext) Registers the provided Metaschema module.
-
Constructor Details
-
PostProcessingModuleLoaderStrategy
public PostProcessingModuleLoaderStrategy(@NonNull List<IModuleLoader.IModulePostProcessor> modulePostProcessors) -
PostProcessingModuleLoaderStrategy
public PostProcessingModuleLoaderStrategy(@NonNull List<IModuleLoader.IModulePostProcessor> modulePostProcessors, @NonNull IBindingContext.IModuleLoaderStrategy delegate)
-
-
Method Details
-
getModulePostProcessors
-
loadModule
Description copied from interface:IBindingContext.IModuleLoaderStrategyLoad the bound Metaschema module represented by the provided class.This is the primary entry point for loading an already bound module. This method must ensure that the loaded module is post-processed and registered.
Implementations are allowed to return a cached instance if the module has already been loaded by this method.
- Specified by:
loadModulein interfaceIBindingContext.IModuleLoaderStrategy- Parameters:
clazz- the Module classbindingContext- the Metaschema binding context used to load bound resources- Returns:
- the module
-
postProcessModule
Description copied from interface:IBindingContext.IModuleLoaderStrategyPerform post-processing on the module.- Specified by:
postProcessModulein interfaceIBindingContext.IModuleLoaderStrategy- Specified by:
postProcessModulein interfaceModuleLoadingPostProcessor- Parameters:
module- the Metaschema module to post-processbindingContext- the Metaschema binding context used to load bound resources
-
registerModule
Description copied from interface:IBindingContext.IModuleLoaderStrategyRegisters the provided Metaschema module.If this module has not been post-processed, this method is expected to drive post-processing first.
If the provided instance is not an instance of
IBoundModule, then annotated Java classes for this module will be generated, compiled, and loaded based on the provided Module.- Specified by:
registerModulein interfaceIBindingContext.IModuleLoaderStrategy- Parameters:
module- the Module module to generate classes forbindingContext- the Metaschema binding context used to load bound resources- Returns:
- the registered module, which may be a different instance than what was provided if dynamic compilation was performed
-
processModule
Perform post-processing on the provided module.- Parameters:
module- the module to post process
-
getBindingMatchers
Description copied from interface:IBindingContext.IModuleLoaderStrategyGet the matchers used to identify the bound class associated with the definition's root name.- Specified by:
getBindingMatchersin interfaceIBindingContext.IModuleLoaderStrategy- Returns:
- the matchers
-
getBoundDefinitionForClass
public IBoundDefinitionModelComplex getBoundDefinitionForClass(Class<? extends IBoundObject> clazz, IBindingContext bindingContext) Description copied from interface:IBindingContext.IModuleLoaderStrategyGet theIBoundDefinitionModelinstance associated with the provided Java class.Typically the class will have a
MetaschemaAssemblyorMetaschemaFieldannotation.- Specified by:
getBoundDefinitionForClassin interfaceIBindingContext.IModuleLoaderStrategy- Parameters:
clazz- the class binding to loadbindingContext- the Metaschema binding context used to load bound resources- Returns:
- the associated class binding instance
-