org.apache.ibatis.abator.api
Interface JavaModelGenerator

All Known Implementing Classes:
JavaModelGeneratorJava2Impl, JavaModelGeneratorLegacyImpl

public interface JavaModelGenerator

This interface describes methods needed in any Java model generator. A Java model generator is used to generate POJOs that match the structure of the table. Typically this includes:

Author:
Jeff Butler

Method Summary
 void addConfigurationProperties(java.util.Properties properties)
          Adds properties for this instance from any properties configured in the JavaModelGeneratorConfiguration.
 FullyQualifiedJavaType getBaseRecordType(FullyQualifiedTable table)
           
 FullyQualifiedJavaType getExampleType(FullyQualifiedTable table)
           
 java.util.List getGeneratedJavaFiles(IntrospectedTable introspectedTable, ProgressCallback callback)
          This method returns a list of GenerateJavaFile objects.
 FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)
           
 FullyQualifiedJavaType getRecordWithBLOBsType(FullyQualifiedTable table)
           
 void setAbatorContext(AbatorContext abatorContext)
          Sets the instance of the AbatorConfiguration object associated with this instance.
 void setTargetPackage(java.lang.String targetPackage)
          Sets the target package of the generator taken from the JavaModelGeneratorConfiguration element.
 void setTargetProject(java.lang.String targetProject)
          Sets the target project of the generator taken from the JavaModelGeneratorConfiguration element.
 void setWarnings(java.util.List warnings)
          Abator will supply a list to this method.
 

Method Detail

addConfigurationProperties

public void addConfigurationProperties(java.util.Properties properties)
Adds properties for this instance from any properties configured in the JavaModelGeneratorConfiguration. This method will be called before any of the get methods.

Parameters:
properties - All properties from the configuration

setAbatorContext

public void setAbatorContext(AbatorContext abatorContext)
Sets the instance of the AbatorConfiguration object associated with this instance. This method will be called before any of the get methods.

Parameters:
abatorContext - The current AbatorContext

setWarnings

public void setWarnings(java.util.List warnings)
Abator will supply a list to this method. The implementation class may add strings to the list that will be treated as warning messages and displayed to the user. The concept of a warning is that code generation can continue, but that the results may not be what is expected.

Parameters:
warnings -

setTargetPackage

public void setTargetPackage(java.lang.String targetPackage)
Sets the target package of the generator taken from the JavaModelGeneratorConfiguration element. This method is called before any getXXX method.

Parameters:
targetPackage - the configuration element's target package

setTargetProject

public void setTargetProject(java.lang.String targetProject)
Sets the target project of the generator taken from the JavaModelGeneratorConfiguration element. This method is called before any getXXX method.

Parameters:
targetProject - the configuration element's target project

getPrimaryKeyType

public FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)

getBaseRecordType

public FullyQualifiedJavaType getBaseRecordType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the record (the class that holds non-primary key and non-BLOB fields). Note that the value will be calculated regardless of whether the table has these columns or not.

getExampleType

public FullyQualifiedJavaType getExampleType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the example class.

getRecordWithBLOBsType

public FullyQualifiedJavaType getRecordWithBLOBsType(FullyQualifiedTable table)
Parameters:
table - the table for which the name should be generated
Returns:
the type for the record with BLOBs class. Note that the value will be calculated regardless of whether the table has BLOB columns or not.

getGeneratedJavaFiles

public java.util.List getGeneratedJavaFiles(IntrospectedTable introspectedTable,
                                            ProgressCallback callback)
This method returns a list of GenerateJavaFile objects. The list may include any, or all, of the following types of generated java classes:

Parameters:
introspectedTable -
callback -
Returns:
a list of GeneratedJavaFile objects