Class NowDataLoader

java.lang.Object
fmpp.dataloaders.NowDataLoader
All Implemented Interfaces:
DataLoader

public class NowDataLoader extends 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"}.

  • Constructor Details

    • NowDataLoader

      public NowDataLoader()
  • Method Details

    • load

      public Object load(Engine engine, List args) throws 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:
      Exception