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
ConstructorDescriptionPostProcessingModuleLoaderStrategy
(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 theIBoundDefinitionModel
instance 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.void
postProcessModule
(IModule module, IBindingContext bindingContext) Perform post-processing on the 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.IModuleLoaderStrategy
Load 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:
loadModule
in 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.IModuleLoaderStrategy
Perform post-processing on the module.- Specified by:
postProcessModule
in interfaceIBindingContext.IModuleLoaderStrategy
- Specified by:
postProcessModule
in interfaceModuleLoadingPostProcessor
- Parameters:
module
- the Metaschema module to post-processbindingContext
- the Metaschema binding context used to load bound resources
-
registerModule
Description copied from interface:IBindingContext.IModuleLoaderStrategy
Registers 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:
registerModule
in 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
-
getBindingMatchers
Description copied from interface:IBindingContext.IModuleLoaderStrategy
Get the matchers used to identify the bound class associated with the definition's root name.- Specified by:
getBindingMatchers
in interfaceIBindingContext.IModuleLoaderStrategy
- Returns:
- the matchers
-
getBoundDefinitionForClass
public IBoundDefinitionModelComplex getBoundDefinitionForClass(Class<? extends IBoundObject> clazz, IBindingContext bindingContext) Description copied from interface:IBindingContext.IModuleLoaderStrategy
Get theIBoundDefinitionModel
instance associated with the provided Java class.Typically the class will have a
MetaschemaAssembly
orMetaschemaField
annotation.- Specified by:
getBoundDefinitionForClass
in interfaceIBindingContext.IModuleLoaderStrategy
- Parameters:
clazz
- the class binding to loadbindingContext
- the Metaschema binding context used to load bound resources- Returns:
- the associated class binding instance
-