public class ScriptEnginePluginAcceptor extends Object implements PluginAcceptor
Constructor and Description |
---|
ScriptEnginePluginAcceptor(ScriptEngine scriptEngine) |
Modifier and Type | Method and Description |
---|---|
void |
addBinding(String key,
Object val)
Add a variable binding for the plugin host.
|
void |
addImports(Set<String> importStatements)
If the ScriptEngine implements the DependencyManager interface it will try to import the specified
import statements.
|
Map<String,Object> |
environment()
Returns a map of implementation specific variables that can be referenced by the plugin.
|
Object |
eval(String script)
Evaluate a script in the ScriptEngine.
|
Map<String,Object> |
getBindings()
Gets the list of bindings from the plugin host.
|
public ScriptEnginePluginAcceptor(ScriptEngine scriptEngine)
public void addBinding(String key, Object val)
PluginAcceptor
addBinding
in interface PluginAcceptor
public Map<String,Object> getBindings()
PluginAcceptor
getBindings
in interface PluginAcceptor
public void addImports(Set<String> importStatements)
addImports
in interface PluginAcceptor
public Object eval(String script) throws ScriptException
eval
in interface PluginAcceptor
ScriptException
public Map<String,Object> environment()
PluginAcceptor
PluginAcceptor
implementations for the variables
that they pass, as they may provide important information useful to the plugin itself.environment
in interface PluginAcceptor
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.