org.apache.ibatis.abator.api
Interface JavaModelGenerator

All Known Implementing Classes:
JavaModelGeneratorJava2Impl, JavaModelGeneratorJava5Impl, 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.Map properties)
          Adds properties for this instance from any properties configured in the JavaModelGeneratorConfiguration.
 void addContextProperties(java.util.Map properties)
          Adds properties for this instance from any properties configured in the current context.
 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 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

void addConfigurationProperties(java.util.Map 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

addContextProperties

void addContextProperties(java.util.Map properties)
Adds properties for this instance from any properties configured in the current context. This method will be called before any of the get methods.

Parameters:
properties - All properties from the configuration

setWarnings

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

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

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

FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)

getBaseRecordType

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

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

getRecordWithBLOBsType

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

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