Package fmpp.dataloaders
Class XmlDataLoader
java.lang.Object
fmpp.dataloaders.XmlDataLoader
- All Implemented Interfaces:
DataLoader
Returns a variable that exposes the content of an XML file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isOptionName
(String optionName) Checks if the string is a valid xml data loader option name.freemarker.template.TemplateNodeModel
static Document
loadXmlFile
(Engine engine, File xmlFile, boolean namespaceAware, boolean validate) static Document
loadXmlFile
(Engine engine, File xmlFile, boolean namespaceAware, boolean xincludeAware, boolean validate)
-
Field Details
-
OPTION_REMOVE_COMMENTS
- See Also:
-
OPTION_REMOVE_PIS
- See Also:
-
OPTION_NAMESPACE_AWARE
- See Also:
-
OPTION_XINCLUDE_AWARE
- See Also:
-
OPTION_VALIDATE
- See Also:
-
OPTION_INDEX
- See Also:
-
OPTION_XMLNS
- See Also:
-
-
Constructor Details
-
XmlDataLoader
public XmlDataLoader()
-
-
Method Details
-
load
- 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:
Exception
-
load
public freemarker.template.TemplateNodeModel load(Engine engine, List args, Document preLoadedDoc) throws Exception - Throws:
Exception
-
isOptionName
Checks if the string is a valid xml data loader option name. Options names are the keys in the hash pased as the 2nd argument to the xml data loader. -
loadXmlFile
public static Document loadXmlFile(Engine engine, File xmlFile, boolean namespaceAware, boolean validate) throws SAXException, IOException, ParserConfigurationException -
loadXmlFile
public static Document loadXmlFile(Engine engine, File xmlFile, boolean namespaceAware, boolean xincludeAware, boolean validate) throws SAXException, IOException, ParserConfigurationException
-