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 (seeEngine.setAttribute(java.lang.String, java.lang.Object)
).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
load(Engine e, java.util.List args)
-
-
-
Method Detail
-
load
java.lang.Object load(Engine e, java.util.List args) throws java.lang.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 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
-
-