Class Functions

java.lang.Object
org.basex.query.func.Functions

public final class Functions extends Object
This class provides access to built-in and user-defined functions.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

  • Method Details

    • staticURI

      public static boolean staticURI(byte[] uri)
      Checks if the specific URI is statically available.
      Parameters:
      uri - URI to check
      Returns:
      result of check
    • wrongArity

      public static QueryException wrongArity(Object function, long arity, IntList arities, InputInfo ii)
      Raises an error for the wrong number of function arguments.
      Parameters:
      function - function
      arity - number of supplied arguments
      arities - expected arities
      ii - input info
      Returns:
      error
    • getLiteral

      public static Expr getLiteral(QNm name, int arity, QueryContext qc, StaticContext sc, InputInfo ii, boolean runtime) throws QueryException
      Gets a function literal for a known function.
      Parameters:
      name - function name
      arity - number of arguments
      qc - query context
      sc - static context
      ii - input info
      runtime - true if this method is called at run-time, false otherwise
      Returns:
      function literal if found, null otherwise
      Throws:
      QueryException - query exception
    • getUser

      public static FuncItem getUser(StaticFunc sf, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Returns a function item for a user-defined function.
      Parameters:
      sf - static function
      qc - query context
      sc - static context
      ii - input info
      Returns:
      resulting value
      Throws:
      QueryException - query exception
    • get

      public static Expr get(QNm name, Expr[] args, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Returns a function call with the specified name and number of arguments.
      Parameters:
      name - name of the function
      args - optional arguments
      qc - query context
      sc - static context
      ii - input info
      Returns:
      function call
      Throws:
      QueryException - query exception