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 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"}.
|
Method Summary |
java.lang.Object |
load(Engine engine,
java.util.List args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NowDataLoader
public NowDataLoader()
load
public java.lang.Object load(Engine engine,
java.util.List args)
throws java.lang.Exception
- Specified by:
load in interface DataLoader
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.
- 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