Interface Function

    • Method Detail

      • getName

        String getName()
        Get the name of this function.
        Returns:
        function name
      • getUsage

        String getUsage()
        Get function usage string. For example: pow(base, exponent).
        Returns:
        function usage string
      • getHelpSummary

        String getHelpSummary()
        Get summarized help (typically a single line).
        Returns:
        one line summarized description of this function
      • parseParams

        Object parseParams​(ParseSession session,
                           ParseContext ctx,
                           boolean complete)
        Parse function parameters.

        The ctx will be pointing at the first parameter (if any) or closing parenthesis. This method should parse (but not evaluate) function parameters up through the closing parenthesis. The return value is an opaque value representing the parsed parameters and subsequently passed to apply().

        Parameters:
        session - parse session
        ctx - parse context
        complete - false if parse is "for real", true if only for tab completion calculation
        Returns:
        parsed parameters object to be passed to apply()
        Throws:
        ParseException - if parse fails, or if complete is true and there are valid completions
      • apply

        Value apply​(ParseSession session,
                    Object params)
        Evaluate this function. There will be a transaction open.
        Parameters:
        session - parse session
        params - parsed parameters returned by parseParams()
        Returns:
        value returned by this function
        Throws:
        RuntimeException - if there is an error