ScriptUtil

Script Utility - ScriptUtil

Introduction

Encapsulation of Script execution tools.

Usage

  1. ScriptUtil.eval Executes Javascript scripts with the script string as the parameter.

Example:

ScriptUtil.eval("print('Script test!');");
  1. ScriptUtil.compile Compiles the script and returns a CompiledScript object.

Example:

CompiledScript script = ScriptUtil.compile("print('Script test!');");
try {
    script.eval();
} catch (ScriptException e) {
    throw new ScriptRuntimeException(e);
}