public interface DataLoader
Life-cycle: Data loaders are short-lived objects. They are created
when the data has to load, and then they are discarded immediately, not
reused. That is, the load(fmpp.Engine, java.util.List)
method is typically (but not by all means)
invoked only once. If a data loader needs to maintain state during a
processing session (such as cache data, pool connections, etc.) it should use
engine attributes for that purpose (see Engine.setAttribute(java.lang.String, java.lang.Object)
).
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
load(Engine e,
java.util.List args) |
java.lang.Object load(Engine e, java.util.List args) throws java.lang.Exception
args
- Arguments that the caller specifies for this directive call.
Not null.
The implementation should check if it understands all arguments,
and it should throw java.lang.IllegalArgumentException
if it doesn't.freemarker.template.TemplateModel
, then it
will not be wrapped, as it is already an FTL variable.java.lang.Exception