Interface ScriptEngine

All Superinterfaces:
AutoCloseable, Closeable

public interface ScriptEngine extends Closeable
A script language implementation.
  • Method Details

    • getType

      String getType()
      The language name used in the script APIs to refer to this scripting backend.
    • compile

      <FactoryType> FactoryType compile(String name, String code, ScriptContext<FactoryType> context, Map<String,String> params)
      Compiles a script.
      name - the name of the script. null if it is anonymous (inline). For a stored script, its the identifier.
      code - actual source of the script
      context - the context this script will be used for
      params - compile-time parameters (such as flags to the compiler)
      A compiled script of the FactoryType from ScriptContext
    • close

      default void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getSupportedContexts

      Set<ScriptContext<?>> getSupportedContexts()
      Script contexts supported by this engine.