Interface PreprocessorExtension


  • public interface PreprocessorExtension
    The interface describes an extension which can be connected to a preprocessor and to be notified about some calls and actions
    • Method Detail

      • processAction

        boolean processAction​(PreprocessorContext context,
                              @MustNotContainNull
                              Value[] parameters)
        To process an action (it will be called if the preprocessor is met //#action directive)
        Parameters:
        context - the current preprocessor context, must not be null
        parameters - the parameters of the action directive, must not be null
        Returns:
        true if the action has been processed successfully or false, if it is false then exception will be thrown and preprocessing will be stopped
      • processUserFunction

        Value processUserFunction​(java.lang.String functionName,
                                  @MustNotContainNull
                                  Value[] arguments)
        Call to process a user function (the function starts with $)
        Parameters:
        functionName - the name of the function (without $ and in low case), must not be null
        arguments - the function arguments as an array, must not be null
        Returns:
        a calculated value, it must not be null
      • getUserFunctionArity

        int getUserFunctionArity​(java.lang.String functionName)
        When a preprocessor meets a user defined function (the function starts with $) then it will ask for its arity
        Parameters:
        functionName - the function name without $ and in low case, must not be null
        Returns:
        the function arity (the argument number), zero or a great value