Interface ScriptFunctionType

All Known Implementing Classes:
BufferFunctions, DataIOFunctions, DateFunctions, DigestFunctions, ErrorFunctions, FileIOFunctions, FileSystemFunctions, JSONFunctions, ListFunctions, MapFunctions, MathFunctions, MiscFunctions, PrintFunctions, RegexFunctions, StreamingIOFunctions, StringFunctions, SystemFunctions, ZipFunctions

public interface ScriptFunctionType
Host function type for scripts.
Matthew Tropiano
  • Method Details

    • name

      String name()
      Gets the name of this function. This name returned must be a valid name that can be parsed in the script ("identifier" type: starts with letter, alphanumeric plus "_").
      the function name.
    • getParameterCount

      int getParameterCount()
      the total amount of parameters this takes.
    • getUsage

      this function's usage instructions.
    • execute

      boolean execute(ScriptInstance scriptInstance, ScriptValue returnValue)
      Executes this function. The value in returnValue is automatically pushed onto the stack after the call. If a Throwable is thrown from this call, it is wrapped in a ScriptExecutionException. ScriptExecutionExceptions are thrown as-is.
      scriptInstance - the originating script instance.
      returnValue - the value pushed to the stack on return.
      if false, this halts script execution, else if true, continue.