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.
Author:
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 "_").
      Returns:
      the function name.
    • getParameterCount

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

      Returns:
      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.
      Parameters:
      scriptInstance - the originating script instance.
      returnValue - the value pushed to the stack on return.
      Returns:
      if false, this halts script execution, else if true, continue.