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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getUserFunctionArity(java.lang.String functionName)
When a preprocessor meets a user defined function (the function starts with $) then it will ask for its arityboolean
processAction(PreprocessorContext context, Value[] parameters)
To process an action (it will be called if the preprocessor is met //#action directive)Value
processUserFunction(java.lang.String functionName, Value[] arguments)
Call to process a user function (the function starts with $)
-
-
-
Method Detail
-
processAction
boolean processAction(PreprocessorContext context, 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 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
Value processUserFunction(java.lang.String functionName, 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 nullarguments
- 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
-
-