Class Config.Builder
java.lang.Object
org.dellroad.javabox.Config.Builder
- Enclosing class:
Config
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theConfig.withControl(Control control) withControls(List<Control> controls) Configure the list ofControls.withDelegateLoader(ClassLoader delegateLoader) Configure theClassLoaderto be used as the delegate loader of the loader that loads the classes generated for applied scripts.withJShellBuilder(JShell.Builder jshellBuilder) Provide a customJShell.Builderto be used to create theJShellinstance.withJShellMods(Consumer<? super JShell.Builder> configurer) Apply a modification to theJShell.Builderthat will be used to create theJShellinstance.
-
Method Details
-
build
-
withJShellMods
Apply a modification to theJShell.Builderthat will be used to create theJShellinstance.The given modification will not actually be applied until
build()is invoked. Modifications are applied in the same order as this method is invoked.- Parameters:
configurer-JShellbuilder configurer- Throws:
IllegalArgumentException- ifjshellBuilderis null
-
withJShellBuilder
- Parameters:
jshellBuilder-JShellbuilder- Throws:
IllegalArgumentException- ifjshellBuilderis null
-
withDelegateLoader
Configure theClassLoaderto be used as the delegate loader of the loader that loads the classes generated for applied scripts.The default value is the current thread's context class loader at the point this builder is instantiated.
- Parameters:
delegateLoader- delegateClassLoader, or null for the system class loader
-
withControls
Configure the list ofControls.In general, controls are applied in the order the appear in the list. For example, if a control modifies bytecode, it will see the modifications of all controls earlier in the list.
The default value is an empty list.
- Parameters:
controls- list of controls- Throws:
IllegalArgumentException- ifcontrolsor any element therein is null
-
withControl
- Parameters:
control- script control- Throws:
IllegalArgumentException- ifcontrolis null
-