Class FromUtilFunction

java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.FromUtilFunction
All Implemented Interfaces:
ContextualUtilFunction

public class FromUtilFunction extends UtilFunction implements ContextualUtilFunction
Represents the 'from' util function that retrieves values from a target object based on the provided context and arguments.
  • Field Details

  • Constructor Details

    • FromUtilFunction

      public FromUtilFunction()
  • Method Details

    • call

      public Object call(HigsonContext ctx, Object[] args)
      Calls the 'from' util function with the given context and arguments.
      • if object is String then function will return part of string after indexed passed in the second argument
      • if object is List then function will return part of list after indexed passed in the second argument
      • in other cases function will throw exception with unsupported type
      Specified by:
      call in class UtilFunction
      Parameters:
      ctx - The HigsonContext object representing the execution context.
      args - The arguments passed to the 'from' util function.
      Returns:
      The result of the 'from' util function, or null if the target is null or of an unsupported type.
      Throws:
      HigsonRuntimeException - if a required argument is missing, or if the target is of an unsupported type.