public class NativeScriptEngineService extends AbstractComponent implements ScriptEngineService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
deprecationLogger, logger, settings
Constructor and Description |
---|
NativeScriptEngineService(Settings settings,
java.util.Map<java.lang.String,NativeScriptFactory> scripts) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.Object |
compile(java.lang.String scriptName,
java.lang.String scriptSource,
java.util.Map<java.lang.String,java.lang.String> params)
Compiles a script.
|
ExecutableScript |
executable(CompiledScript compiledScript,
java.util.Map<java.lang.String,java.lang.Object> vars) |
java.lang.String |
getExtension()
The extension for file scripts in this language.
|
java.lang.String |
getType() |
boolean |
isInlineScriptEnabled()
Returns
true if this scripting engine can safely accept inline scripts by default. |
SearchScript |
search(CompiledScript compiledScript,
SearchLookup lookup,
java.util.Map<java.lang.String,java.lang.Object> vars) |
logDeprecatedSetting, logRemovedSetting, nodeName
public static final java.lang.String NAME
public NativeScriptEngineService(Settings settings, java.util.Map<java.lang.String,NativeScriptFactory> scripts)
public java.lang.String getType()
getType
in interface ScriptEngineService
public java.lang.String getExtension()
ScriptEngineService
getExtension
in interface ScriptEngineService
public java.lang.Object compile(java.lang.String scriptName, java.lang.String scriptSource, java.util.Map<java.lang.String,java.lang.String> params)
ScriptEngineService
compile
in interface ScriptEngineService
scriptName
- name of the script. null
if it is anonymous (inline).
For a file script, its the file name (with extension).
For a stored script, its the identifier.scriptSource
- actual source of the scriptparams
- compile-time parameters (such as flags to the compiler)public ExecutableScript executable(CompiledScript compiledScript, @Nullable java.util.Map<java.lang.String,java.lang.Object> vars)
executable
in interface ScriptEngineService
public SearchScript search(CompiledScript compiledScript, SearchLookup lookup, @Nullable java.util.Map<java.lang.String,java.lang.Object> vars)
search
in interface ScriptEngineService
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean isInlineScriptEnabled()
ScriptEngineService
true
if this scripting engine can safely accept inline scripts by default. The default is false
isInlineScriptEnabled
in interface ScriptEngineService