Class UserDefinedFunction

    • Constructor Detail

      • UserDefinedFunction

        public UserDefinedFunction​(UserDefinedFunctionDefinition def)
        Creates a new user defined function
        Parameters:
        def - Function Definition
      • UserDefinedFunction

        public UserDefinedFunction​(java.lang.String url,
                                   Expr e,
                                   java.util.List<Var> argList)
        Creates a user defined function
        Parameters:
        url - Function URL
        e - Expression
        argList - Arguments
    • Method Detail

      • build

        public void build​(java.lang.String uri,
                          ExprList args)
        Builds the expression substituting the arguments given into the base expression to yield the actual expression to evaluate
        Specified by:
        build in interface Function
        args - The parsed arguments
        Throws:
        ExprBuildException - Thrown if an expression cannot be generated
      • exec

        public NodeValue exec​(Binding binding,
                              ExprList args,
                              java.lang.String uri,
                              FunctionEnv env)
        Executes the function
        Specified by:
        exec in interface Function
        Parameters:
        binding - The current solution
        args - A list of unevaluated expressions
        uri - The name of this
        env - The execution context
        Returns:
        NodeValue - a value
      • getActualExpr

        public Expr getActualExpr()
        Gets the actual expression that was built for the function, assuming build(String, ExprList) has been called
        Returns:
        Expression if built, null otherwise