Package fmpp.dataloaders
Class NowDataLoader
- java.lang.Object
-
- fmpp.dataloaders.NowDataLoader
-
- All Implemented Interfaces:
DataLoader
public class NowDataLoader extends java.lang.Object implements DataLoader
Data loader that produces string from the current date. It is maybe better to usepp.sessionStart
orpp.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 Constructor Description NowDataLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
load(Engine engine, java.util.List args)
-
-
-
Method Detail
-
load
public java.lang.Object load(Engine engine, java.util.List args) throws java.lang.Exception
- Specified by:
load
in interfaceDataLoader
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:
java.lang.Exception
-
-