Package io.github.erdos.stencil.functions
Custom Functions
It is possible to define custom functions on the host code and invoke them from within the template files.
Custom functions must implement the Function
interface and be registered
to the template evaluator engine.
Functions are found by their case-insensitive name so make sure not to override any existing function implementation.
Functions on null arguments should return null.
Functions are variadic, i.e. they accept a variable number of arguments. Handling the correct number and type of arguments is the responsibility of the functions implementation.
Make your functions as flexible as possible by considering proper type and error handling.
-
Interface Summary Interface Description Function A function object can be called from inside a template file.FunctionsProvider -
Class Summary Class Description BasicFunctions.Provider DateFunctions.Provider FunctionEvaluator LocaleFunctions.Provider NumberFunctions.Provider StringFunctions.Provider -
Enum Summary Enum Description BasicFunctions Common general purpose functions.DateFunctions Date handling functionsLocaleFunctions NumberFunctions Common numeric functions.StringFunctions Common string functions.