public class ScriptApi
extends Object
| Modifier and Type | Field and Description |
|---|---|
javax.script.ScriptEngine |
engine |
java.util.Stack<java.io.File> |
includeStack |
| Constructor and Description |
|---|
ScriptApi() |
| Modifier and Type | Method and Description |
|---|---|
Object |
addInjectableObject(Object object)
Registers the object as an object which can be injected later into an
uninitialized property.
|
Object |
include(String fileName)
Include another configuration file.
|
void |
injectMissingPropertyValues(Object object,
java.util.List<String> initializedProperties)
Initializes the properties that has not got a value explicitly and are
annotated with @Inject annotation with default objects selected from the
set of injectable objects.
|
Object |
manage(Object object)
Registers objects created by the configuration script for lifecycle
management, which includes calling methods marked with
PostConstruct and PreDestroy annotations. |
public javax.script.ScriptEngine engine
public final java.util.Stack<java.io.File> includeStack
public Object include(String fileName)
throws java.io.IOException,
javax.script.ScriptException
fileName - the path to the script file to be included. Relative paths are
resolved against the mireka.home directory.java.io.IOException - thrown if the file cannot be openedjavax.script.ScriptException - thrown if the script in the included file cannot be run
because of a syntactic or semantic errorpublic Object manage(Object object)
PostConstruct and PreDestroy annotations.object - the object which may have a lifecycle annotation.Lifecyclepublic Object addInjectableObject(Object object)
object - The object which can be injectedDependencyInjection.addInjectable(Object)public void injectMissingPropertyValues(Object object,
java.util.List<String> initializedProperties)
object - The object that may have uninitialized propertiesinitializedProperties - The list of properties which were explicitly initialized.DependencyInjection.injectDependencies(Object, List)