Interface IScriptRunModuleConfigurator.ModuleCreator
- Enclosing interface:
IScriptRunModuleConfigurator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Creates a
JavaNativeModule from the given information.
This method is a functional interface whose functional method is
createNativeModule(String, String, List, Consumer).
- Since:
- 9.1.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateNativeModule(String name, String rootPackage, List<JavaNativeModule> dependencies, Consumer<JavaNativeModule> configurator) Creates aJavaNativeModulefrom the given information.
-
Method Details
-
createNativeModule
JavaNativeModule createNativeModule(String name, String rootPackage, List<JavaNativeModule> dependencies, Consumer<JavaNativeModule> configurator) throws CompileException Creates aJavaNativeModulefrom the given information.The module is also automatically initialized so that the ZenCode scripting environment has all the required information to proceed. Any special module configuration that must be ran between the module creation and any preparatory work executed by ZenCode, such as adding classes or globals, must be executed in the
configuratorConsumer. Additional non-critical configuration can be executed in the consumer or deferred after the return of this method.- Parameters:
name- The name of the module to create.rootPackage- The root package that identifies this module.dependencies- A list ofJavaNativeModules representing the dependencies of the module.configurator- AConsumerresponsible for performing additional configuration work on the module between its creation and its preparation for the ZenCode scripting environment. Critical tasks such as adding classes and expansions must be performed here. Non-critical tasks do not have to be performed here.- Returns:
- A newly created and prepared module according to the given information.
- Throws:
CompileException- If compilation of the module during the preparation phase failed.- Since:
- 9.1.0
-