public class Context extends PropertyHolder
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addPluginConfiguration(PluginConfiguration pluginConfiguration)
Adds the plugin configuration.
|
void |
addProperty(String name,
String value) |
void |
addTableConfiguration(TableConfiguration tc)
Adds the table configuration.
|
boolean |
autoDelimitKeywords()
Auto delimit keywords.
|
void |
generateFiles(ProgressCallback callback,
List<GeneratedJavaFile> generatedJavaFiles,
List<GeneratedXmlFile> generatedXmlFiles,
List<String> warnings)
Generate files.
|
String |
getBeginningDelimiter()
Gets the beginning delimiter.
|
CommentGenerator |
getCommentGenerator()
Gets the comment generator.
|
CommentGeneratorConfiguration |
getCommentGeneratorConfiguration()
Gets the comment generator configuration.
|
ModelType |
getDefaultModelType()
Gets the default model type.
|
String |
getEndingDelimiter()
Gets the ending delimiter.
|
int |
getGenerationSteps()
Gets the generation steps.
|
String |
getId()
Gets the id.
|
String |
getIntrospectedColumnImpl()
Gets the introspected column impl.
|
int |
getIntrospectionSteps()
Gets the introspection steps.
|
JavaClientGeneratorConfiguration |
getJavaClientGeneratorConfiguration()
Gets the java client generator configuration.
|
JavaFormatter |
getJavaFormatter()
Gets the java formatter.
|
JavaModelGeneratorConfiguration |
getJavaModelGeneratorConfiguration()
Gets the java model generator configuration.
|
JavaTypeResolverConfiguration |
getJavaTypeResolverConfiguration()
Gets the java type resolver configuration.
|
JDBCConnectionConfiguration |
getJdbcConnectionConfiguration()
Gets the jdbc connection configuration.
|
Plugin |
getPlugins()
Gets the plugins.
|
SqlMapGeneratorConfiguration |
getSqlMapGeneratorConfiguration()
Gets the sql map generator configuration.
|
List<TableConfiguration> |
getTableConfigurations()
Gets the table configurations.
|
String |
getTargetRuntime()
Gets the target runtime.
|
XmlFormatter |
getXmlFormatter()
Gets the xml formatter.
|
void |
introspectTables(ProgressCallback callback,
List<String> warnings,
Set<String> fullyQualifiedTableNames)
Introspect tables based on the configuration specified in the
constructor.
|
void |
setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
Sets the comment generator configuration.
|
void |
setId(String id)
Sets the id.
|
void |
setIntrospectedColumnImpl(String introspectedColumnImpl)
Sets the introspected column impl.
|
void |
setJavaClientGeneratorConfiguration(JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)
Sets the java client generator configuration.
|
void |
setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
Sets the java model generator configuration.
|
void |
setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
Sets the java type resolver configuration.
|
void |
setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
Sets the jdbc connection configuration.
|
void |
setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
Sets the sql map generator configuration.
|
void |
setTargetRuntime(String targetRuntime)
Sets the target runtime.
|
XmlElement |
toXmlElement()
Builds an XmlElement representation of this context.
|
void |
validate(List<String> errors)
This method does a simple validate, it makes sure that all required fields have been filled in.
|
addPropertyXmlElements, getProperties, getPropertypublic Context(ModelType defaultModelType)
defaultModelType - - may be nullpublic void addTableConfiguration(TableConfiguration tc)
tc - the tcpublic JDBCConnectionConfiguration getJdbcConnectionConfiguration()
public JavaClientGeneratorConfiguration getJavaClientGeneratorConfiguration()
public JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
public JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
public SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
public void addPluginConfiguration(PluginConfiguration pluginConfiguration)
pluginConfiguration - the plugin configurationpublic void validate(List<String> errors)
errors - the errorspublic String getId()
public void setId(String id)
id - the new idpublic void setJavaClientGeneratorConfiguration(JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)
javaClientGeneratorConfiguration - the new java client generator configurationpublic void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
javaModelGeneratorConfiguration - the new java model generator configurationpublic void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
javaTypeResolverConfiguration - the new java type resolver configurationpublic void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
jdbcConnectionConfiguration - the new jdbc connection configurationpublic void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
sqlMapGeneratorConfiguration - the new sql map generator configurationpublic ModelType getDefaultModelType()
public XmlElement toXmlElement()
validate method to check validity of this context.public List<TableConfiguration> getTableConfigurations()
public String getBeginningDelimiter()
public String getEndingDelimiter()
public void addProperty(String name, String value)
addProperty 在类中 PropertyHolderpublic CommentGenerator getCommentGenerator()
public JavaFormatter getJavaFormatter()
public XmlFormatter getXmlFormatter()
public CommentGeneratorConfiguration getCommentGeneratorConfiguration()
public void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
commentGeneratorConfiguration - the new comment generator configurationpublic Plugin getPlugins()
public String getTargetRuntime()
public void setTargetRuntime(String targetRuntime)
targetRuntime - the new target runtimepublic String getIntrospectedColumnImpl()
public void setIntrospectedColumnImpl(String introspectedColumnImpl)
introspectedColumnImpl - the new introspected column implpublic int getIntrospectionSteps()
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames) throws SQLException, InterruptedException
callback - a progress callback if progress information is desired, or
nullwarnings - any warning generated from this method will be added to the
List. Warnings are always Strings.fullyQualifiedTableNames - a set of table names to generate. The elements of the set must
be Strings that exactly match what's specified in the
configuration. For example, if table name = "foo" and schema =
"bar", then the fully qualified table name is "foo.bar". If
the Set is null or empty, then all tables in the configuration
will be used for code generation.SQLException - if some error arises while introspecting the specified
database tables.InterruptedException - if the progress callback reports a cancelpublic int getGenerationSteps()
public void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings) throws InterruptedException
callback - the callbackgeneratedJavaFiles - the generated java filesgeneratedXmlFiles - the generated xml fileswarnings - the warningsInterruptedException - the interrupted exceptionpublic boolean autoDelimitKeywords()
Copyright © 2006–2016 MyBatis.org. All rights reserved.