Package fmpp.tdd

Interface DataLoader

All Known Implementing Classes:
AbstractTextDataLoader, AntDataLoader, AntProjectDataLoader, AntPropertiesDataLoader, AntPropertyDataLoader, AntTaskDataLoader, CsvDataLoader, EvalDataLoader, FileDataLoader, HtmlUtilsDataLoader, JSONDataLoader, NowDataLoader, PropertiesDataLoader, SlicedTextDataLoader, TddDataLoader, TddSequenceDataLoader, TextDataLoader, XmlDataLoader, XmlInfosetDataLoader

public interface DataLoader
Creates an object that will be accessed in FreeMarker templates. The typical usage is with the "data" setting, to load data from external sources as XML files, databases, etc. Different implementations of this interface know different kind of sources.

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)).

  • Method Summary

    Modifier and Type
    Method
    Description
    load(Engine e, List args)
     
  • Method Details

    • load

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