Class RequireBuilder

  • All Implemented Interfaces:
    java.io.Serializable

    public class RequireBuilder
    extends java.lang.Object
    implements java.io.Serializable
    A builder for Require instances. Useful when you're creating many instances of Require that are identical except for their top-level scope and current Context. Also useful if you prefer configuring it using named setters instead of passing many parameters in a constructor. Every setter returns "this", so you can easily chain their invocations for additional convenience.
    See Also:
    Serialized Form
    • Constructor Detail

      • RequireBuilder

        public RequireBuilder()
    • Method Detail

      • setModuleScriptProvider

        public RequireBuilder setModuleScriptProvider​(ModuleScriptProvider moduleScriptProvider)
        Sets the ModuleScriptProvider for the Require instances that this builder builds.
        Parameters:
        moduleScriptProvider - the module script provider for the Require instances that this builder builds.
        Returns:
        this, so you can chain ("fluidize") setter invocations
      • setPostExec

        public RequireBuilder setPostExec​(Script postExec)
        Sets the script that should execute in every module's scope after the module's own script has executed.
        Parameters:
        postExec - the post-exec script.
        Returns:
        this, so you can chain ("fluidize") setter invocations
      • setPreExec

        public RequireBuilder setPreExec​(Script preExec)
        Sets the script that should execute in every module's scope before the module's own script has executed.
        Parameters:
        preExec - the pre-exec script.
        Returns:
        this, so you can chain ("fluidize") setter invocations