org.apache.metamodel.xml
Class XmlSaxDataContext
java.lang.Object
org.apache.metamodel.AbstractDataContext
org.apache.metamodel.QueryPostprocessDataContext
org.apache.metamodel.xml.XmlSaxDataContext
- All Implemented Interfaces:
- HasReadTypeConverters, DataContext
public class XmlSaxDataContext
- extends QueryPostprocessDataContext
XML datacontext which uses SAX parsing for fast and memory effecient reading
of XML files.
The DataContext requires the user to specify a set of (simplified) XPaths to
define which elements are row delimitors and which elements or attributes are
value/column definitions.
| Methods inherited from class org.apache.metamodel.QueryPostprocessDataContext |
addConverter, executeCountQuery, executePrimaryKeyLookupQuery, executeQuery, getDefaultSchemaName, getMainSchemaInternal, getSchemaByNameInternal, getSchemaNamesInternal, isMainSchemaTable, materializeFromItem, materializeMainSchemaTable, materializeMainSchemaTable, materializeMainSchemaTable, materializeTable, materializeTable |
| Methods inherited from class org.apache.metamodel.AbstractDataContext |
compileQuery, executeQuery, executeQuery, getColumnByQualifiedLabel, getDefaultSchema, getSchemaByName, getSchemaNames, getSchemas, getTableByQualifiedLabel, isQualifiedPathDelim, parseQuery, query, refreshSchemas |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLUMN_NAME_ROW_ID
public static final String COLUMN_NAME_ROW_ID
- See Also:
- Constant Field Values
XmlSaxDataContext
public XmlSaxDataContext(Ref<InputSource> inputSourceRef,
XmlSaxTableDef... tableDefs)
- Constructs an XML DataContext based on SAX parsing.
- Parameters:
inputSourceRef - a factory reference for the input source to read the XML from.
The ref will be repeatedly called for each access to the file!tableDefs - an array of table definitions, which provide instructions as
to the xpaths to apply to the document.- See Also:
XmlSaxTableDef
XmlSaxDataContext
public XmlSaxDataContext(Resource resource,
XmlSaxTableDef... tableDefs)
XmlSaxDataContext
public XmlSaxDataContext(File file,
XmlSaxTableDef... tableDefs)
getMainSchema
protected Schema getMainSchema()
throws MetaModelException
- Specified by:
getMainSchema in class QueryPostprocessDataContext
- Throws:
MetaModelException
getMainSchemaName
protected String getMainSchemaName()
throws MetaModelException
- Specified by:
getMainSchemaName in class QueryPostprocessDataContext
- Throws:
MetaModelException
materializeMainSchemaTable
protected DataSet materializeMainSchemaTable(Table table,
Column[] columns,
int maxRows)
- Specified by:
materializeMainSchemaTable in class QueryPostprocessDataContext
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.