public class XmlSaxDataContextFactory extends Object implements DataContextFactory
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 and Description |
---|
XmlSaxDataContextFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(DataContextProperties properties,
ResourceFactoryRegistry resourceFactoryRegistry) |
DataContext |
create(DataContextProperties properties,
ResourceFactoryRegistry resourceFactoryRegistry) |
public boolean accepts(DataContextProperties properties, ResourceFactoryRegistry resourceFactoryRegistry)
accepts
in interface DataContextFactory
public DataContext create(DataContextProperties properties, ResourceFactoryRegistry resourceFactoryRegistry) throws UnsupportedDataContextPropertiesException, ConnectionException
create
in interface DataContextFactory
UnsupportedDataContextPropertiesException
ConnectionException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.