Class ScriptStackFrame.Builder

java.lang.Object
org.praxislive.script.ScriptStackFrame.Builder
Enclosing class:
ScriptStackFrame

public static class ScriptStackFrame.Builder extends Object
A builder for ScriptStackFrame.
See Also:
  • Method Details

    • inline

      public ScriptStackFrame.Builder inline()
      Run the script directly in the provided namespace rather than a child.
      Returns:
      this for chaining
    • trapErrors

      public ScriptStackFrame.Builder trapErrors()
      Trap errors. Error messages will be aggregated and script execution will attempt to continue. If no allowed commands have been specified, an empty list of allowed commands will be set.
      Returns:
      this for chaining
    • allowedCommands

      public ScriptStackFrame.Builder allowedCommands(List<String> commands)
      Specify a list of allowed commands to filter those available from the provided namespace.
      Parameters:
      commands - list of allowed commands
      Returns:
      this for chaining
    • createConstant

      public ScriptStackFrame.Builder createConstant(String id, Value value)
      Create a constant with the given name and value in the script namespace.
      Parameters:
      id - constant name
      value - constant value
      Returns:
      this for chaining
    • createVariable

      public ScriptStackFrame.Builder createVariable(String id, Value value)
      Create a variable with the given name and value in the script namespace.
      Parameters:
      id - variable name
      value - variable value
      Returns:
      this for chaining
    • build

      public ScriptStackFrame build()
      Build the ScriptStackFrame.
      Returns:
      script stackframe