Class FunctionBase

All Implemented Interfaces:
Direct Known Subclasses:
cartesian, context, execTime, FN_AdjustDatetimeToTimezone, FN_AdjustDateToTimezone, FN_AdjustTimeToTimezone, FN_Apply, FN_Error, FN_FormatNumber, FN_Round, FN_Round_Half_Even, FN_StrConcat, FN_StrNormalizeUnicode, FN_StrReplace, FN_StrSubstring, FunctionBase0, FunctionBase1, FunctionBase2, FunctionBase3, FunctionBase4, FunctionBase5, log, rnd, ScriptFunction, sprintf, strjoin, substring

public abstract class FunctionBase extends Object implements Function
Implementation root for custom function evaluation.
  • Constructor Details

    • FunctionBase

      public FunctionBase()
  • Method Details

    • build

      public final void build(String uri, ExprList args)
      Description copied from interface: Function
      Called during query plan construction immediately after the construction of the extension instance. Can throw ExprBuildException if something is wrong (like wrong number of arguments).
      Specified by:
      build in interface Function
      args - The parsed arguments
    • exec

      public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env)
      Description copied from interface: Function
      Test a list of values - argument will not be null but may have the wrong number of arguments. FunctionBase provides a more convenient way to implement a function. Can throw ExprEvalsException if something goes wrong.
      Specified by:
      exec in interface Function
      binding - The current solution
      args - A list of unevaluated expressions
      uri - The name of this
      env - The execution context
      NodeValue - a value
    • evalArgs

      public static List<NodeValue> evalArgs(Binding binding, ExprList args, FunctionEnv env)
    • exec

      public abstract NodeValue exec(List<NodeValue> args)
      Function call to a list of evaluated argument values
    • checkBuild

      public abstract void checkBuild(String uri, ExprList args)