|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectdk.eobjects.metamodel.DataContextFactory
public class DataContextFactory
A factory for DataContext objects. This class substantially easens the task of creating and initializing DataContext objects and their strategies for reading datastores. A lot of the factory methods support column type detection, narrowing and transformation. For details on this approach to datastores.
ColumnTypeTransformer,
DataContext,
IDataContextStrategy| Field Summary | |
|---|---|
static char |
DEFAULT_CSV_QUOTE_CHAR
|
static char |
DEFAULT_CSV_SEPARATOR_CHAR
|
static TableType[] |
DEFAULT_JDBC_TABLE_TYPES
|
| Method Summary | |
|---|---|
static DataContext |
createAccessDataContext(java.io.File file)
Creates a DataContext based on a MS Access (.mdb) file |
static DataContext |
createAccessDataContext(java.lang.String filename)
Creates a DataContext based on a MS Access (.mdb) file |
static DataContext |
createCompositeDataContext(java.util.Collection<DataContext> delegates)
Creates a composite DataContext based on a set of delegate DataContexts. |
static DataContext |
createCompositeDataContext(DataContext... delegates)
Creates a composite DataContext based on a set of delegate DataContexts. |
static DataContext |
createCsvDataContext(java.io.File file)
Creates a DataContext based on a CSV file |
static DataContext |
createCsvDataContext(java.io.File file,
boolean transformColumnTypes)
Creates a DataContext based on a CSV file |
static DataContext |
createCsvDataContext(java.io.File file,
char separatorChar,
char quoteChar,
boolean transformColumnTypes)
Creates a DataContext based on a CSV file |
static DataContext |
createCsvDataContext(java.io.File file,
char separatorChar,
char quoteChar,
boolean transformColumnTypes,
java.lang.String encoding)
Creates a DataContext based on a CSV file |
static DataContext |
createCsvDataContext(java.io.InputStream inputStream,
char separatorChar,
char quoteChar,
boolean transformColumnTypes)
Creates a DataContext based on CSV-content through an input stream |
static DataContext |
createDbaseDataContext(java.io.File file)
Creates a DataContext based on a dBase file |
static DataContext |
createDbaseDataContext(java.lang.String filename)
Creates a DataContext based on a dBase file |
static DataContext |
createExcelDataContext(java.io.File file)
Creates a DataContet based on an Excel spreadsheet file |
static DataContext |
createExcelDataContext(java.io.File file,
boolean transformColumnTypes)
Creates a DataContext based on an Excel spreadsheet file |
static DataContext |
createJdbcDataContext(java.sql.Connection connection)
Creates a DataContext based on a JDBC connection |
static DataContext |
createJdbcDataContext(java.sql.Connection connection,
java.lang.String catalogName)
Creates a DataContext based on a JDBC connection |
static DataContext |
createJdbcDataContext(java.sql.Connection connection,
java.lang.String catalogName,
TableType[] tableTypes)
Creates a DataContext based on a JDBC connection |
static DataContext |
createJdbcDataContext(java.sql.Connection connection,
TableType... tableTypes)
Creates a DataContext based on a JDBC connection |
static DataContext |
createJdbcDataContext(javax.sql.DataSource ds)
Creates a DataContext based on a JDBC datasource |
static DataContext |
createJdbcDataContext(javax.sql.DataSource ds,
java.lang.String catalogName)
Creates a DataContext based on a JDBC datasource |
static DataContext |
createJdbcDataContext(javax.sql.DataSource ds,
java.lang.String catalogName,
TableType[] tableTypes)
Creates a DataContext based on a JDBC datasource |
static DataContext |
createJdbcDataContext(javax.sql.DataSource ds,
TableType... tableTypes)
Creates a DataContext based on a JDBC datasource |
static DataContext |
createOpenOfficeDataContext(java.io.File file)
Creates a DataContext based on an OpenOffice.org database file. |
static DataContext |
createXmlDataContext(java.io.File file,
boolean autoFlattenTables,
boolean transformColumnTypes)
Creates a DataContext based on a XML file. |
static DataContext |
createXmlDataContext(org.xml.sax.InputSource inputSource,
java.lang.String schemaName,
boolean autoFlattenTables,
boolean transformColumnTypes)
Creates a DataContext based on XML-content from an input source. |
static DataContext |
createXmlDataContext(java.net.URL url,
boolean autoFlattenTables,
boolean transformColumnTypes)
Creates a DataContext based on XML-content from a URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final TableType[] DEFAULT_JDBC_TABLE_TYPES
public static final char DEFAULT_CSV_SEPARATOR_CHAR
public static final char DEFAULT_CSV_QUOTE_CHAR
| Method Detail |
|---|
public static DataContext createCompositeDataContext(DataContext... delegates)
delegates - an array/var-args of delegate DataContexts
public static DataContext createCompositeDataContext(java.util.Collection<DataContext> delegates)
delegates - a collection of delegate DataContexts
public static DataContext createAccessDataContext(java.lang.String filename)
filename - the path to a MS Access (.mdb) file
public static DataContext createAccessDataContext(java.io.File file)
file - a MS Access (.mdb) file
public static DataContext createDbaseDataContext(java.io.File file)
file - a dBase (.dbf) file
public static DataContext createDbaseDataContext(java.lang.String filename)
the - path to a dBase (.dbf) file
public static DataContext createCsvDataContext(java.io.File file)
file - a CSV file
public static DataContext createCsvDataContext(java.io.File file,
boolean transformColumnTypes)
file - a CSV filetransformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createCsvDataContext(java.io.File file,
char separatorChar,
char quoteChar,
boolean transformColumnTypes)
file - a CSV fileseparatorChar - the char to use for separating valuesquoteChar - the char used for quoting values (typically if they include
the separator char)transformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createCsvDataContext(java.io.File file,
char separatorChar,
char quoteChar,
boolean transformColumnTypes,
java.lang.String encoding)
file - a CSV fileseparatorChar - the char to use for separating valuesquoteChar - the char used for quoting values (typically if they include
the separator char)transformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column typesencoding - the character encoding of the file
public static DataContext createCsvDataContext(java.io.InputStream inputStream,
char separatorChar,
char quoteChar,
boolean transformColumnTypes)
inputStream - the input stream to read fromseparatorChar - the char to use for separating valuesquoteChar - the char used for quoting values (typically if they include
the separator char)transformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createExcelDataContext(java.io.File file)
file - an excel spreadsheet file
public static DataContext createExcelDataContext(java.io.File file,
boolean transformColumnTypes)
file - an Excel spreadsheet filetransformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createXmlDataContext(java.io.File file,
boolean autoFlattenTables,
boolean transformColumnTypes)
file - a XML fileautoFlattenTables - a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modeltransformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createXmlDataContext(org.xml.sax.InputSource inputSource,
java.lang.String schemaName,
boolean autoFlattenTables,
boolean transformColumnTypes)
inputSource - an input source feeding XML contentschemaName - the name to be used for the main schemaautoFlattenTables - a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modeltransformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createXmlDataContext(java.net.URL url,
boolean autoFlattenTables,
boolean transformColumnTypes)
url - the URL to use for feeding XML contentautoFlattenTables - a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modeltransformColumnTypes - a boolean indicating if MetaModel should detect, narrow and
transform column types
public static DataContext createOpenOfficeDataContext(java.io.File file)
file - an OpenOffice.org database file
public static DataContext createJdbcDataContext(java.sql.Connection connection)
connection - a JDBC connection
public static DataContext createJdbcDataContext(javax.sql.DataSource ds)
ds - a JDBC datasource
public static DataContext createJdbcDataContext(java.sql.Connection connection,
java.lang.String catalogName)
connection - a JDBC connectioncatalogName - a catalog name to use
public static DataContext createJdbcDataContext(java.sql.Connection connection,
TableType... tableTypes)
connection - a JDBC connectiontableTypes - the types of tables to include in the generated schemas
public static DataContext createJdbcDataContext(java.sql.Connection connection,
java.lang.String catalogName,
TableType[] tableTypes)
connection - a JDBC connectioncatalogName - a catalog name to usetableTypes - the types of tables to include in the generated schemas
public static DataContext createJdbcDataContext(javax.sql.DataSource ds,
TableType... tableTypes)
ds - a JDBC datasourcetableTypes - the types of tables to include in the generated schemas
public static DataContext createJdbcDataContext(javax.sql.DataSource ds,
java.lang.String catalogName,
TableType[] tableTypes)
ds - a JDBC datasourcecatalogName - a catalog name to usetableTypes - the types of tables to include in the generated schemas
public static DataContext createJdbcDataContext(javax.sql.DataSource ds,
java.lang.String catalogName)
ds - a JDBC datasourcecatalogName - a catalog name to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||