Class MustacheScriptEngine

java.lang.Object
org.elasticsearch.script.mustache.MustacheScriptEngine
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.script.ScriptEngine

public final class MustacheScriptEngine extends Object implements org.elasticsearch.script.ScriptEngine
Main entry point handling template registration, compilation and execution. Template handling is based on Mustache. Template handling is a two step process: First compile the string representing the template, the resulting Mustache object can then be re-used for subsequent executions.
  • Field Details

  • Constructor Details

    • MustacheScriptEngine

      public MustacheScriptEngine()
  • Method Details

    • compile

      public <T> T compile(String templateName, String templateSource, org.elasticsearch.script.ScriptContext<T> context, Map<String,​String> options)
      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.
      Specified by:
      compile in interface org.elasticsearch.script.ScriptEngine
      Parameters:
      templateSource - a string representing the template to compile.
      Returns:
      a compiled template object for later execution.
    • getSupportedContexts

      public Set<org.elasticsearch.script.ScriptContext<?>> getSupportedContexts()
      Specified by:
      getSupportedContexts in interface org.elasticsearch.script.ScriptEngine
    • getType

      public String getType()
      Specified by:
      getType in interface org.elasticsearch.script.ScriptEngine