Interface to be implemented by context variables that need to be loaded lazily.
Variables implementing this interface have the opportunity to not be completely resolved at context build
time, but instead wait until the variable is actually used in an expression executed from the template. This can
importantly reduce the amount of memory required to store context variables per template in scenarios when
many variables are made available to the templates in a generic manner (e.g. in frameworks that allow
users to create their own templates), but templates might afterwards choose not to use some or many of these
variables.
Note this lazy resolution can only be performed when the lazy variable is added to the context as a
first-level variable. i.e.
${lazy}} will work, but
${container.lazy}}
will not.
The
LazyContextVariable abstract class contains a sensible implementation of this interface, best
suited to be used for extension than the bare interface, in most cases.