public interface EngineBinder
| Modifier and Type | Method and Description |
|---|---|
EngineBinder |
disposer(Consumer<Engine> disposer)
Binds a disposer that is executed when the engine is disposed or if the
script cache is expired.
|
EngineBinder |
globalVariable(String name,
Object value)
Adds a global variable to the script engine.
|
EngineBinder |
initializer(Consumer<Engine> initializer)
Binds an initializer that is executed when the engine is created.
|
<T> EngineBinder |
instance(Class<T> type,
T instance)
Binds an instance to a type.
|
<T> EngineBinder |
provider(Class<T> type,
Supplier<T> supplier)
Binds a provider of a type.
|
<T> EngineBinder instance(Class<T> type, T instance)
T - type of instance.type - type to bind.instance - instance of the type.<T> EngineBinder provider(Class<T> type, Supplier<T> supplier)
T - type of instance.type - type to bind.supplier - the supplier (or factory) to create an instance of type.EngineBinder globalVariable(String name, Object value)
name - name of variable.value - variable instance.EngineBinder initializer(Consumer<Engine> initializer)
initializer - initializer to bind.EngineBinder disposer(Consumer<Engine> disposer)
disposer - disposer to bind.