Package com.igormaznitsa.jcp.extension
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 Summary
Modifier and TypeMethodDescriptionintgetUserFunctionArity(String functionName) When a preprocessor meets a user defined function (the function starts with $) then it will ask for its aritybooleanprocessAction(PreprocessorContext context, Value[] parameters) To process an action (it will be called if the preprocessor is met //#action directive)processUserFunction(String functionName, Value[] arguments) Call to process a user function (the function starts with $)
-
Method Details
-
processAction
To process an action (it will be called if the preprocessor is met //#action directive)- Parameters:
context- the current preprocessor context, must not be nullparameters- 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
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 nullarguments- the function arguments as an array, must not be null- Returns:
- a calculated value, it must not be null
-
getUserFunctionArity
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
-