Package io.github.erdos.stencil.functions
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.
-
ClassDescriptionCommon general purpose functions.Date handling functionsA function object can be called from inside a template file.Common numeric functions.Common string functions.