org.apache.metamodel.xml
Class XmlSaxDataContext

java.lang.Object
  extended by org.apache.metamodel.AbstractDataContext
      extended by org.apache.metamodel.QueryPostprocessDataContext
          extended by 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.


Field Summary
static String COLUMN_NAME_ROW_ID
           
 
Fields inherited from class org.apache.metamodel.QueryPostprocessDataContext
INFORMATION_SCHEMA_NAME
 
Constructor Summary
XmlSaxDataContext(File file, XmlSaxTableDef... tableDefs)
           
XmlSaxDataContext(Ref<InputSource> inputSourceRef, XmlSaxTableDef... tableDefs)
          Constructs an XML DataContext based on SAX parsing.
XmlSaxDataContext(Resource resource, XmlSaxTableDef... tableDefs)
           
 
Method Summary
protected  Schema getMainSchema()
           
protected  String getMainSchemaName()
           
protected  DataSet materializeMainSchemaTable(Table table, Column[] columns, int maxRows)
           
 
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
 

Field Detail

COLUMN_NAME_ROW_ID

public static final String COLUMN_NAME_ROW_ID
See Also:
Constant Field Values
Constructor Detail

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)
Method Detail

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.