Class UtilFunctionExecutorImpl

java.lang.Object
io.higson.runtime.builtin.executor.UtilFunctionExecutorImpl
All Implemented Interfaces:
UtilFunctionExecutor

public class UtilFunctionExecutorImpl extends Object implements UtilFunctionExecutor
Utility function executor is a helper class for executing utility functions. It consists of built-in functions.

Includes a map of function implementations, where key is the method name and value is the function implementation instance. It also includes the type converter to convert different types of input to the expected type.

Makes use of two indexes to manage function arguments - one for rest arguments and one for path arguments.

  • Field Details

  • Constructor Details

    • UtilFunctionExecutorImpl

      public UtilFunctionExecutorImpl()
  • Method Details

    • execute

      public Object execute(String functionCode, HigsonContext ctx, Object[] args)
      Description copied from interface: UtilFunctionExecutor
      Executes the given utility function given a function code, a context, and a set of arguments.
      Specified by:
      execute in interface UtilFunctionExecutor
      Parameters:
      functionCode - The utility function to be executed.
      ctx - The context in which the function is executed.
      args - The arguments provided for the utility function.
      Returns:
      the result of the utility function execution.
    • supportedFunctions

      public Set<String> supportedFunctions()
      Specified by:
      supportedFunctions in interface UtilFunctionExecutor