Class XmlDataLoader

  • All Implemented Interfaces:
    DataLoader

    public class XmlDataLoader
    extends java.lang.Object
    implements DataLoader
    Returns a variable that exposes the content of an XML file.
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlDataLoader()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isOptionName​(java.lang.String optionName)
      Checks if the string is a valid xml data loader option name.
      java.lang.Object load​(Engine engine, java.util.List args)  
      freemarker.template.TemplateNodeModel load​(Engine engine, java.util.List args, org.w3c.dom.Document preLoadedDoc)  
      static org.w3c.dom.Document loadXmlFile​(Engine engine, java.io.File xmlFile, boolean namespaceAware, boolean validate)  
      static org.w3c.dom.Document loadXmlFile​(Engine engine, java.io.File xmlFile, boolean namespaceAware, boolean xincludeAware, boolean validate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlDataLoader

        public XmlDataLoader()
    • Method Detail

      • 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
      • load

        public freemarker.template.TemplateNodeModel load​(Engine engine,
                                                          java.util.List args,
                                                          org.w3c.dom.Document preLoadedDoc)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isOptionName

        public static boolean isOptionName​(java.lang.String optionName)
        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 org.w3c.dom.Document loadXmlFile​(Engine engine,
                                                       java.io.File xmlFile,
                                                       boolean namespaceAware,
                                                       boolean validate)
                                                throws org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.parsers.ParserConfigurationException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
      • loadXmlFile

        public static org.w3c.dom.Document loadXmlFile​(Engine engine,
                                                       java.io.File xmlFile,
                                                       boolean namespaceAware,
                                                       boolean xincludeAware,
                                                       boolean validate)
                                                throws org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.parsers.ParserConfigurationException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException