Interface ScriptAgent


public interface ScriptAgent
Agent providing methods for handling scripts.
Since:
5.2.250706
  • Field Details

  • Method Details

    • checkSyntax

      void checkSyntax(@NotNull @NotNull String source) throws SyntaxError
      Verifies the syntax of a script.
      Parameters:
      source - The source of the script, must not be null.
      Throws:
      SyntaxError - If the script could not be parsed.
      Since:
      5.2.250706
    • execute

      @Nullable @Nullable Object execute(@NotNull @NotNull String scriptIdentifier, @NotNull @NotNull Map<String,Object> parameters)
      Executes the script with the given identifier. The parameters are passed to Executable.execute(Map) after adding a matching context object with the key context.
      Parameters:
      scriptIdentifier - Either a script UID (e.g. script:my-script, only available in a project-context) or a class name (e.g. class:com.example.script.MyScript). Must not be null.
      parameters - A map of parameters to be passed to the script. Must not be null.
      Returns:
      The result of the script execution, may be null.
      Since:
      5.2.250706
    • execute

      @Nullable @Nullable Object execute(@NotNull @NotNull Script script, @NotNull @NotNull Map<String,Object> parameters)

      Executes the given script. The parameters are passed to Executable.execute(Map) after adding a matching context object with the key context.

      Please note that this method may only be called in a project-context.

      Parameters:
      script - The script to execute, must not be null.
      parameters - A map of parameters to be passed to the script. Must not be null.
      Returns:
      The result of the script execution, may be null.
      Since:
      5.2.250706
    • execute

      @Nullable @Nullable Object execute(@NotNull @NotNull Executable executable, @NotNull @NotNull Map<String,Object> parameters)
      Executes the given executable. The parameters are passed to Executable.execute(Map) after adding a matching context object with the key context.
      Parameters:
      executable - The executable to execute, must not be null.
      parameters - A map of parameters to be passed to the executable. Must not be null.
      Returns:
      The result of the execution, may be null.
      Since:
      5.2.250706