Interface FunctionIfc

    • Method Detail

      • getFunctionParameterDefinitions

        java.util.List<FunctionParameterDefinition> getFunctionParameterDefinitions()
        Returns the list of parameter definitions. Is never empty or null.
        Returns:
        The parameter definition list.
      • evaluate

        EvaluationValue evaluate​(Expression expression,
                                 Token functionToken,
                                 EvaluationValue... parameterValues)
                          throws EvaluationException
        Performs the function logic and returns an evaluation result.
        Parameters:
        expression - The expression, where this function is executed. Can be used to access the expression configuration.
        functionToken - The function token from the parsed expression.
        parameterValues - The parameter values.
        Returns:
        The evaluation result in form of a EvaluationValue.
        Throws:
        EvaluationException - In case there were problems during evaluation.
      • validatePreEvaluation

        void validatePreEvaluation​(Token token,
                                   EvaluationValue... parameterValues)
                            throws EvaluationException
        Validates the evaluation parameters, called before the actual evaluation.
        Parameters:
        token - The function token.
        parameterValues - The parameter values
        Throws:
        EvaluationException - in case of any validation error
      • hasVarArgs

        boolean hasVarArgs()
        Checks whether the function has a variable number of arguments parameter.
        Returns:
        true or false:
      • isParameterLazy

        default boolean isParameterLazy​(int parameterIndex)
        Checks if the parameter is a lazy parameter.
        Parameters:
        parameterIndex - The parameter index, starts at 0 for the first parameter. If the index is bigger than the list of parameter definitions, the last parameter definition will be checked.
        Returns:
        true if the specified parameter is defined as lazy.
      • getCountOfNonVarArgParameters

        default int getCountOfNonVarArgParameters()
        Returns the count of non-var-arg parameters defined by this function. If the function has var-args, the result is the count of parameter definitions - 1.
        Returns:
        the count of non-var-arg parameters defined by this function.