Class XmlSaxDataContextFactory

  • All Implemented Interfaces:
    org.apache.metamodel.factory.DataContextFactory

    public class XmlSaxDataContextFactory
    extends Object
    implements org.apache.metamodel.factory.DataContextFactory
    A DataContextFactory for XML files where a "table-defs" or "xml-sax-table-defs" element has been configured and represents the tables and their XPaths as defined by XmlSaxDataContext. If "table-defs" is specified, it will first be interpreted as a SimpleTableDef which is then mapped to a XmlSaxTableDef. Alternatively, if "xml-sax-table-defs" is specified, it may either be a List, like this (JSON representation of lists and maps):
     [
       {
         "row-x-path": "/path/to/entity1"
         "value-x-paths": [
           "/path/to/entity1/var1",
           "/path/to/entity1/var2"
         ]
       },
       {
         "row-x-path": "/path/to/model2"
         "value-x-paths": [
           "/path/to/model2/field3",
           "/path/to/model2/field4"
         ]
       }
     ]
     
    Or a key/value map, like this:
       {
         "/path/to/entity1": [
           "/path/to/entity1/var1",
           "/path/to/entity1/var2"
         ],
         "/path/to/model2": [
           "/path/to/model2/field3",
           "/path/to/model2/field4"
         ]
       }
     
    • Constructor Detail

      • XmlSaxDataContextFactory

        public XmlSaxDataContextFactory()
    • Method Detail

      • accepts

        public boolean accepts​(org.apache.metamodel.factory.DataContextProperties properties,
                               org.apache.metamodel.factory.ResourceFactoryRegistry resourceFactoryRegistry)
        Specified by:
        accepts in interface org.apache.metamodel.factory.DataContextFactory
      • create

        public org.apache.metamodel.DataContext create​(org.apache.metamodel.factory.DataContextProperties properties,
                                                       org.apache.metamodel.factory.ResourceFactoryRegistry resourceFactoryRegistry)
                                                throws org.apache.metamodel.factory.UnsupportedDataContextPropertiesException,
                                                       org.apache.metamodel.ConnectionException
        Specified by:
        create in interface org.apache.metamodel.factory.DataContextFactory
        Throws:
        org.apache.metamodel.factory.UnsupportedDataContextPropertiesException
        org.apache.metamodel.ConnectionException