Package fmpp.dataloaders
Class NowDataLoader
java.lang.Object
fmpp.dataloaders.NowDataLoader
- All Implemented Interfaces:
DataLoader
Data loader that produces string from the current date.
It is maybe better to use
pp.sessionStart
or
pp.now
instead of this data loader.
The format of the directive is:
now(options)
, where options is a hash as:
{pattern:"yyyy-MM-dd HH:mm:ss"}
or
{date:short, time:long, zone:"GMT+0"}
.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NowDataLoader
public NowDataLoader()
-
-
Method Details
-
load
- Specified by:
load
in interfaceDataLoader
- Parameters:
args
- Arguments that the caller specifies for this directive call. Not null. The implementation should check if it understands all arguments, and it should throwjava.lang.IllegalArgumentException
if it doesn't.- Returns:
- The object that will be accessed in FreeMarker templates.
The object can be of any type. FreeMarker will wrap the object so
that it is visible as an FTL variable. However, if the object
implements
freemarker.template.TemplateModel
, then it will not be wrapped, as it is already an FTL variable. - Throws:
Exception
-