public class DataContextFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<DataContext>, DataContextFactoryParameters
FactoryBean
that produces MetaModel DataContext
objects based on property values that will typically be injected by the
Spring configuration.Constructor and Description |
---|
DataContextFactoryBean() |
Modifier and Type | Method and Description |
---|---|
String |
getCatalogName() |
String |
getColumnNameLineNumber() |
String |
getDatabaseName() |
DataSource |
getDataSource() |
String |
getDriverClassName() |
String |
getEncoding() |
String |
getEscapeChar() |
String |
getFailOnInconsistentRowLength() |
String |
getFilename() |
String |
getHostname() |
String |
getMultilineValues() |
DataContext |
getObject() |
Class<DataContext> |
getObjectType() |
String |
getPassword() |
Integer |
getPort() |
String |
getQuoteChar() |
org.springframework.core.io.Resource |
getResource() |
String |
getSeparatorChar() |
String |
getSkipEmptyColumns() |
String |
getSkipEmptyLines() |
SimpleTableDef[] |
getTableDefs() |
TableType[] |
getTableTypes() |
String |
getType() |
String |
getUrl() |
String |
getUsername() |
boolean |
isSingleton() |
void |
setCatalogName(String catalogName) |
void |
setColumnNameLineNumber(String columnNameLineNumber) |
void |
setDatabaseName(String databaseName) |
void |
setDataSource(DataSource dataSource) |
void |
setDriverClassName(String driverClassName) |
void |
setEncoding(String encoding) |
void |
setEscapeChar(String escapeChar) |
void |
setFailOnInconsistentRowLength(String failOnInconsistentRowLength) |
void |
setFilename(String filename) |
void |
setHostname(String hostname) |
void |
setMultilineValues(String multilineValues) |
void |
setPassword(String password) |
void |
setPort(Integer port) |
void |
setQuoteChar(String quoteChar) |
void |
setResource(org.springframework.core.io.Resource resource) |
void |
setSeparatorChar(String separatorChar) |
void |
setSkipEmptyColumns(String skipEmptyColumns) |
void |
setSkipEmptyLines(String skipEmptyLines) |
void |
setTableDefinitions(String tableDefinitionsText)
Sets the
SimpleTableDef s of getTableDefs() by providing
a string representation of the following form (like a CREATE TABLE
statement, except for the literal 'CREATE TABLE' prefix, and without
column sizes):
tablename1 (
columnName1 VARCHAR,
columnName2 INTEGER,
columnName3 DATE
);
tablename2 (
columnName4 BIGINT,
columnName5 CHAR,
columnName6 BINARY
);
Each table definition is delimited/ended by the semi-colon (;) character. |
void |
setTableDefs(SimpleTableDef[] tableDefs) |
void |
setTableTypes(TableType[] tableTypes) |
void |
setType(String type) |
void |
setUrl(String url) |
void |
setUsername(String username) |
public DataContext getObject() throws Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<DataContext>
Exception
public void setTableDefinitions(String tableDefinitionsText) throws IllegalArgumentException
SimpleTableDef
s of getTableDefs()
by providing
a string representation of the following form (like a CREATE TABLE
statement, except for the literal 'CREATE TABLE' prefix, and without
column sizes):
tablename1 (
columnName1 VARCHAR,
columnName2 INTEGER,
columnName3 DATE
);
tablename2 (
columnName4 BIGINT,
columnName5 CHAR,
columnName6 BINARY
);
Each table definition is delimited/ended by the semi-colon (;) character.
The parser is at this point quite simple and restricts that column names
cannot contain parentheses, commas, semi-colons or spaces. No quote
characters or escape characters are available. Newlines, return carriages
and tabs are ignored.tableDefinitionsText
- IllegalArgumentException
public Class<DataContext> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<DataContext>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<DataContext>
public String getType()
public void setType(String type)
public org.springframework.core.io.Resource getResource()
getResource
in interface DataContextFactoryParameters
public void setResource(org.springframework.core.io.Resource resource)
public String getFilename()
getFilename
in interface DataContextFactoryParameters
public void setFilename(String filename)
public String getUrl()
getUrl
in interface DataContextFactoryParameters
public void setUrl(String url)
public String getColumnNameLineNumber()
getColumnNameLineNumber
in interface DataContextFactoryParameters
public void setColumnNameLineNumber(String columnNameLineNumber)
public String getSkipEmptyLines()
getSkipEmptyLines
in interface DataContextFactoryParameters
public void setSkipEmptyLines(String skipEmptyLines)
public String getSkipEmptyColumns()
getSkipEmptyColumns
in interface DataContextFactoryParameters
public void setSkipEmptyColumns(String skipEmptyColumns)
public String getEncoding()
getEncoding
in interface DataContextFactoryParameters
public void setEncoding(String encoding)
public String getSeparatorChar()
getSeparatorChar
in interface DataContextFactoryParameters
public void setSeparatorChar(String separatorChar)
public String getQuoteChar()
getQuoteChar
in interface DataContextFactoryParameters
public void setQuoteChar(String quoteChar)
public String getEscapeChar()
getEscapeChar
in interface DataContextFactoryParameters
public void setEscapeChar(String escapeChar)
public String getFailOnInconsistentRowLength()
getFailOnInconsistentRowLength
in interface DataContextFactoryParameters
public void setFailOnInconsistentRowLength(String failOnInconsistentRowLength)
public String getMultilineValues()
getMultilineValues
in interface DataContextFactoryParameters
public void setMultilineValues(String multilineValues)
public TableType[] getTableTypes()
getTableTypes
in interface DataContextFactoryParameters
public void setTableTypes(TableType[] tableTypes)
public String getCatalogName()
getCatalogName
in interface DataContextFactoryParameters
public void setCatalogName(String catalogName)
public DataSource getDataSource()
getDataSource
in interface DataContextFactoryParameters
public void setDataSource(DataSource dataSource)
public String getUsername()
getUsername
in interface DataContextFactoryParameters
public void setUsername(String username)
public String getPassword()
getPassword
in interface DataContextFactoryParameters
public void setPassword(String password)
public String getDriverClassName()
getDriverClassName
in interface DataContextFactoryParameters
public void setDriverClassName(String driverClassName)
public String getHostname()
getHostname
in interface DataContextFactoryParameters
public void setHostname(String hostname)
public Integer getPort()
getPort
in interface DataContextFactoryParameters
public void setPort(Integer port)
public String getDatabaseName()
getDatabaseName
in interface DataContextFactoryParameters
public void setDatabaseName(String databaseName)
public SimpleTableDef[] getTableDefs()
getTableDefs
in interface DataContextFactoryParameters
public void setTableDefs(SimpleTableDef[] tableDefs)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.