org.mybatis.generator.config
Class Context

java.lang.Object
  extended by org.mybatis.generator.config.PropertyHolder
      extended by org.mybatis.generator.config.Context

public class Context
extends PropertyHolder

Author:
Jeff Butler

Constructor Summary
Context(ModelType defaultModelType)
          Constructs a Context object.
 
Method Summary
 void addPluginConfiguration(PluginConfiguration pluginConfiguration)
           
 void addProperty(String name, String value)
           
 void addTableConfiguration(TableConfiguration tc)
           
 boolean autoDelimitKeywords()
           
 void generateFiles(ProgressCallback callback, List<GeneratedJavaFile> generatedJavaFiles, List<GeneratedXmlFile> generatedXmlFiles, List<String> warnings)
           
 String getBeginningDelimiter()
           
 CommentGenerator getCommentGenerator()
           
 CommentGeneratorConfiguration getCommentGeneratorConfiguration()
           
 ModelType getDefaultModelType()
           
 String getEndingDelimiter()
           
 int getGenerationSteps()
           
 String getId()
           
 String getIntrospectedColumnImpl()
           
 int getIntrospectionSteps()
           
 JavaClientGeneratorConfiguration getJavaClientGeneratorConfiguration()
           
 JavaFormatter getJavaFormatter()
           
 JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
           
 JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
           
 JDBCConnectionConfiguration getJdbcConnectionConfiguration()
           
 Plugin getPlugins()
           
 SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
           
 List<TableConfiguration> getTableConfigurations()
           
 String getTargetRuntime()
           
 XmlFormatter getXmlFormatter()
           
 void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
          Introspect tables based on the configuration specified in the constructor.
 void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
           
 void setId(String id)
           
 void setIntrospectedColumnImpl(String introspectedColumnImpl)
           
 void setJavaClientGeneratorConfiguration(JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)
           
 void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
           
 void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
           
 void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
           
 void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
           
 void setTargetRuntime(String targetRuntime)
           
 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.
 
Methods inherited from class org.mybatis.generator.config.PropertyHolder
addPropertyXmlElements, getProperties, getProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(ModelType defaultModelType)
Constructs a Context object.

Parameters:
defaultModelType - - may be null
Method Detail

addTableConfiguration

public void addTableConfiguration(TableConfiguration tc)

getJdbcConnectionConfiguration

public JDBCConnectionConfiguration getJdbcConnectionConfiguration()

getJavaClientGeneratorConfiguration

public JavaClientGeneratorConfiguration getJavaClientGeneratorConfiguration()

getJavaModelGeneratorConfiguration

public JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()

getJavaTypeResolverConfiguration

public JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()

getSqlMapGeneratorConfiguration

public SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()

addPluginConfiguration

public void addPluginConfiguration(PluginConfiguration pluginConfiguration)

validate

public void validate(List<String> errors)
This method does a simple validate, it makes sure that all required fields have been filled in. It does not do any more complex operations such as validating that database tables exist or validating that named columns exist


getId

public String getId()

setId

public void setId(String id)

setJavaClientGeneratorConfiguration

public void setJavaClientGeneratorConfiguration(JavaClientGeneratorConfiguration javaClientGeneratorConfiguration)

setJavaModelGeneratorConfiguration

public void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)

setJavaTypeResolverConfiguration

public void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)

setJdbcConnectionConfiguration

public void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)

setSqlMapGeneratorConfiguration

public void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)

getDefaultModelType

public ModelType getDefaultModelType()

toXmlElement

public XmlElement toXmlElement()
Builds an XmlElement representation of this context. Note that the XML may not necessarily validate if the context is invalid. Call the validate method to check validity of this context.

Returns:
the XML representation of this context

getTableConfigurations

public List<TableConfiguration> getTableConfigurations()

getBeginningDelimiter

public String getBeginningDelimiter()

getEndingDelimiter

public String getEndingDelimiter()

addProperty

public void addProperty(String name,
                        String value)
Overrides:
addProperty in class PropertyHolder

getCommentGenerator

public CommentGenerator getCommentGenerator()

getJavaFormatter

public JavaFormatter getJavaFormatter()

getXmlFormatter

public XmlFormatter getXmlFormatter()

getCommentGeneratorConfiguration

public CommentGeneratorConfiguration getCommentGeneratorConfiguration()

setCommentGeneratorConfiguration

public void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)

getPlugins

public Plugin getPlugins()

getTargetRuntime

public String getTargetRuntime()

setTargetRuntime

public void setTargetRuntime(String targetRuntime)

getIntrospectedColumnImpl

public String getIntrospectedColumnImpl()

setIntrospectedColumnImpl

public void setIntrospectedColumnImpl(String introspectedColumnImpl)

getIntrospectionSteps

public int getIntrospectionSteps()

introspectTables

public void introspectTables(ProgressCallback callback,
                             List<String> warnings,
                             Set<String> fullyQualifiedTableNames)
                      throws SQLException,
                             InterruptedException
Introspect tables based on the configuration specified in the constructor. This method is long running.

Parameters:
callback - a progress callback if progress information is desired, or null
warnings - 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.
Throws:
SQLException - if some error arises while introspecting the specified database tables.
InterruptedException - if the progress callback reports a cancel

getGenerationSteps

public int getGenerationSteps()

generateFiles

public void generateFiles(ProgressCallback callback,
                          List<GeneratedJavaFile> generatedJavaFiles,
                          List<GeneratedXmlFile> generatedXmlFiles,
                          List<String> warnings)
                   throws InterruptedException
Throws:
InterruptedException

autoDelimitKeywords

public boolean autoDelimitKeywords()


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.