org.apache.ibatis.abator.config
Class AbatorContext

java.lang.Object
  extended byorg.apache.ibatis.abator.config.PropertyHolder
      extended byorg.apache.ibatis.abator.config.AbatorContext

public class AbatorContext
extends PropertyHolder

Author:
Jeff Butler

Constructor Summary
AbatorContext(java.lang.String generatorSetType, ModelType defaultModelType)
          Constructs an AbatorContext object.
 
Method Summary
 void addProperty(java.lang.String name, java.lang.String value)
           
 void addTableConfiguration(TableConfiguration tc)
           
 void generateFiles(ProgressCallback callback, java.util.List generatedJavaFiles, java.util.List generatedXmlFiles, java.util.List warnings, java.util.Set fullyQualifiedTableNames)
          Generate iBATIS artifacts based on the configuration specified in the constructor.
 java.lang.String getBeginningDelimiter()
           
 CommentGenerator getCommentGenerator()
           
 CommentGeneratorConfiguration getCommentGeneratorConfiguration()
           
 DAOGeneratorConfiguration getDaoGeneratorConfiguration()
           
 ModelType getDefaultModelType()
           
 java.lang.String getEndingDelimiter()
           
 GeneratorSet getGeneratorSet()
           
 java.lang.String getId()
           
 JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()
           
 JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()
           
 JDBCConnectionConfiguration getJdbcConnectionConfiguration()
           
 SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()
           
 boolean getSuppressTypeWarnings()
           
 java.util.List getTableConfigurations()
           
 int getTotalSteps()
           
 void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)
           
 void setDaoGeneratorConfiguration(DAOGeneratorConfiguration daoGeneratorConfiguration)
           
 void setId(java.lang.String id)
           
 void setJavaModelGeneratorConfiguration(JavaModelGeneratorConfiguration javaModelGeneratorConfiguration)
           
 void setJavaTypeResolverConfiguration(JavaTypeResolverConfiguration javaTypeResolverConfiguration)
           
 void setJdbcConnectionConfiguration(JDBCConnectionConfiguration jdbcConnectionConfiguration)
           
 void setSqlMapGeneratorConfiguration(SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration)
           
 XmlElement toXmlElement()
          Builds an XmlElement representation of this context.
 void validate(java.util.List errors)
          This method does a simple validate, it makes sure that all required fields have been filled in and that all implementation classes exist and are of the proper type.
 
Methods inherited from class org.apache.ibatis.abator.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

AbatorContext

public AbatorContext(java.lang.String generatorSetType,
                     ModelType defaultModelType)
Constructs an AbatorContext object.

Parameters:
generatorSetType - - may be null
defaultModelType - - may be null
Method Detail

addTableConfiguration

public void addTableConfiguration(TableConfiguration tc)

getJdbcConnectionConfiguration

public JDBCConnectionConfiguration getJdbcConnectionConfiguration()

getDaoGeneratorConfiguration

public DAOGeneratorConfiguration getDaoGeneratorConfiguration()

getJavaModelGeneratorConfiguration

public JavaModelGeneratorConfiguration getJavaModelGeneratorConfiguration()

getJavaTypeResolverConfiguration

public JavaTypeResolverConfiguration getJavaTypeResolverConfiguration()

getSqlMapGeneratorConfiguration

public SqlMapGeneratorConfiguration getSqlMapGeneratorConfiguration()

validate

public void validate(java.util.List errors)
This method does a simple validate, it makes sure that all required fields have been filled in and that all implementation classes exist and are of the proper type. It does not do any more complex operations such as: Validating that database tables exist or Validating that named columns exist


generateFiles

public void generateFiles(ProgressCallback callback,
                          java.util.List generatedJavaFiles,
                          java.util.List generatedXmlFiles,
                          java.util.List warnings,
                          java.util.Set fullyQualifiedTableNames)
                   throws java.sql.SQLException,
                          java.lang.InterruptedException
Generate iBATIS artifacts 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
generatedJavaFiles - any Java file generated from this method will be added to the List The objects will be of type GeneratedJavaFile.
generatedXmlFiles - any XML file generated from this method will be added to the List. The objects will be of type GeneratedXMLFile.
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:
java.sql.SQLException - if some error arrises while introspecting the specified database tables.
java.lang.InterruptedException - if the progress callback reports a cancel

getTotalSteps

public int getTotalSteps()

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

getGeneratorSet

public GeneratorSet getGeneratorSet()

setDaoGeneratorConfiguration

public void setDaoGeneratorConfiguration(DAOGeneratorConfiguration daoGeneratorConfiguration)

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 necessarity 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 java.util.List getTableConfigurations()

getBeginningDelimiter

public java.lang.String getBeginningDelimiter()

getEndingDelimiter

public java.lang.String getEndingDelimiter()

addProperty

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

getSuppressTypeWarnings

public boolean getSuppressTypeWarnings()

getCommentGenerator

public CommentGenerator getCommentGenerator()

getCommentGeneratorConfiguration

public CommentGeneratorConfiguration getCommentGeneratorConfiguration()

setCommentGeneratorConfiguration

public void setCommentGeneratorConfiguration(CommentGeneratorConfiguration commentGeneratorConfiguration)