public class MustacheScriptEngineService extends AbstractComponent implements ScriptEngineService
Mustache object can then be re-used for subsequent executions.| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
componentSettings, logger, settings| Constructor and Description |
|---|
MustacheScriptEngineService(Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Object |
compile(String template)
Compile a template string to (in this case) a Mustache object than can
later be re-used for execution to fill in missing parameter values.
|
ExecutableScript |
executable(Object mustache,
Map<String,Object> vars) |
Object |
execute(Object template,
Map<String,Object> vars)
Execute a compiled template object (as retrieved from the compile method)
and fill potential place holders with the variables given.
|
String[] |
extensions() |
boolean |
sandboxed() |
void |
scriptRemoved(CompiledScript script)
Handler method called when a script is removed from the Guava cache.
|
SearchScript |
search(Object compiledScript,
SearchLookup lookup,
Map<String,Object> vars) |
String[] |
types() |
Object |
unwrap(Object value) |
nodeNamepublic static final String NAME
public Object compile(String template)
compile in interface ScriptEngineServicetemplate - a string representing the template to compile.public Object execute(Object template, Map<String,Object> vars)
execute in interface ScriptEngineServicetemplate - compiled template object.vars - map of variables to use during substitution.public String[] types()
types in interface ScriptEngineServicepublic String[] extensions()
extensions in interface ScriptEngineServicepublic boolean sandboxed()
sandboxed in interface ScriptEngineServicepublic ExecutableScript executable(Object mustache, @Nullable Map<String,Object> vars)
executable in interface ScriptEngineServicepublic SearchScript search(Object compiledScript, SearchLookup lookup, @Nullable Map<String,Object> vars)
search in interface ScriptEngineServicepublic Object unwrap(Object value)
unwrap in interface ScriptEngineServicepublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void scriptRemoved(CompiledScript script)
ScriptEngineServicescriptRemoved in interface ScriptEngineServiceCopyright © 2009–2016. All rights reserved.