|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ibatis.abator.internal.java.model.JavaModelGeneratorJava2Impl
public class JavaModelGeneratorJava2Impl
This class supports the following properties:
Field Summary | |
---|---|
protected AbatorContext |
abatorContext
|
protected java.util.Properties |
properties
The properties from the JavaModelGenerator congiguration element |
protected java.lang.String |
targetPackage
The target package from the JavaModelGenerator congiguration element |
protected java.lang.String |
targetProject
The target project from the JavaModelGenerator congiguration element |
protected java.util.List |
warnings
|
Constructor Summary | |
---|---|
JavaModelGeneratorJava2Impl()
|
Method Summary | |
---|---|
void |
addConfigurationProperties(java.util.Properties properties)
Adds properties for this instance from any properties configured in the JavaModelGeneratorConfiguration. |
protected void |
afterBaseRecordGenerationHook(IntrospectedTable introspectedTable,
TopLevelClass topLevelClass)
Override this method to provide any extra customization needed in the generated base record class |
protected void |
afterExampleGenerationHook(IntrospectedTable introspectedTable,
TopLevelClass topLevelClass)
Override this method to provide any extra customization needed in the generated example class |
protected void |
afterPrimaryKeyGenerationHook(IntrospectedTable introspectedTable,
TopLevelClass topLevelClass)
Override this method to provide any extra customization needed in the generated primary key class |
protected void |
afterRecordWithBLOBsGenerationHook(IntrospectedTable introspectedTable,
TopLevelClass topLevelClass)
Override this method to provide any extra customization needed in the generated base record class |
protected void |
generateClassParts(FullyQualifiedTable table,
java.util.Iterator columnDefinitions,
TopLevelClass topLevelClass,
java.lang.String rootClass)
Adds fields and getter/setter methods for each ColumnDefinition passed into the method. |
protected TopLevelClass |
getBaseRecord(IntrospectedTable introspectedTable)
|
FullyQualifiedJavaType |
getBaseRecordType(FullyQualifiedTable table)
|
protected InnerClass |
getCriteriaInnerClass(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
|
protected TopLevelClass |
getExample(IntrospectedTable introspectedTable)
|
FullyQualifiedJavaType |
getExampleType(FullyQualifiedTable table)
|
java.util.List |
getGeneratedJavaFiles(IntrospectedTable introspectedTable,
ProgressCallback callback)
This method returns a list of GenerateJavaFile objects. |
protected java.lang.String |
getJavaModelPackage(FullyQualifiedTable table)
Calculates the package for generated domain objects. |
protected Method |
getNoValueMethod(ColumnDefinition cd,
java.lang.String nameFragment,
java.lang.String operator)
|
protected TopLevelClass |
getPrimaryKey(IntrospectedTable introspectedTable)
|
FullyQualifiedJavaType |
getPrimaryKeyType(FullyQualifiedTable table)
|
protected TopLevelClass |
getRecordWithBLOBs(IntrospectedTable introspectedTable)
|
FullyQualifiedJavaType |
getRecordWithBLOBsType(FullyQualifiedTable table)
|
protected java.lang.String |
getRootClass(IntrospectedTable introspectedTable)
|
protected java.beans.PropertyDescriptor[] |
getRootClassPropertyDescriptors(java.lang.String rootClass)
|
protected Method |
getSetBetweenOrNotBetweenMethod(ColumnDefinition cd,
boolean betweenMethod)
Generates methods that set between and not between conditions |
protected Method |
getSetEqualMethod(ColumnDefinition cd)
|
protected Method |
getSetGreaterThanMethod(ColumnDefinition cd)
|
protected Method |
getSetGreaterThenOrEqualMethod(ColumnDefinition cd)
|
protected Method |
getSetInOrNotInMethod(ColumnDefinition cd,
boolean inMethod)
|
protected Method |
getSetLessThanMethod(ColumnDefinition cd)
|
protected Method |
getSetLessThanOrEqualMethod(ColumnDefinition cd)
|
protected Method |
getSetLikeMethod(ColumnDefinition cd)
|
protected Method |
getSetNotEqualMethod(ColumnDefinition cd)
|
protected Method |
getSetNotLikeMethod(ColumnDefinition cd)
|
protected Method |
getSetNotNullMethod(ColumnDefinition cd)
|
protected Method |
getSetNullMethod(ColumnDefinition cd)
|
protected Method |
getSingleValueMethod(ColumnDefinition cd,
java.lang.String nameFragment,
java.lang.String operator)
|
protected boolean |
propertyExistsInRootClass(ColumnDefinition columnDefinition,
java.lang.String rootClass)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AbatorContext abatorContext
protected java.util.List warnings
protected java.util.Properties properties
protected java.lang.String targetPackage
protected java.lang.String targetProject
Constructor Detail |
---|
public JavaModelGeneratorJava2Impl()
Method Detail |
---|
public void addConfigurationProperties(java.util.Properties properties)
JavaModelGenerator
addConfigurationProperties
in interface JavaModelGenerator
properties
- All properties from the configurationpublic void setTargetPackage(java.lang.String targetPackage)
JavaModelGenerator
setTargetPackage
in interface JavaModelGenerator
targetPackage
- the configuration element's target packageprotected void generateClassParts(FullyQualifiedTable table, java.util.Iterator columnDefinitions, TopLevelClass topLevelClass, java.lang.String rootClass)
table
- the table from which the ColumnDefinitions are derived. This
is used to generate appropriate JavaDoc comments for the
generated fields and methods.columnDefinitions
- the collection of ColumnDefinitions used to generate fields
and getter/setter methods.topLevelClass
- the generated fields and methods will be added to this objectprotected java.lang.String getJavaModelPackage(FullyQualifiedTable table)
table
- the current table
protected TopLevelClass getPrimaryKey(IntrospectedTable introspectedTable)
protected TopLevelClass getBaseRecord(IntrospectedTable introspectedTable)
protected TopLevelClass getRecordWithBLOBs(IntrospectedTable introspectedTable)
public void setTargetProject(java.lang.String targetProject)
JavaModelGenerator
setTargetProject
in interface JavaModelGenerator
targetProject
- the configuration element's target projectpublic FullyQualifiedJavaType getExampleType(FullyQualifiedTable table)
getExampleType
in interface JavaModelGenerator
table
- the table for which the name should be generated
public java.util.List getGeneratedJavaFiles(IntrospectedTable introspectedTable, ProgressCallback callback)
JavaModelGenerator
getGeneratedJavaFiles
in interface JavaModelGenerator
protected void afterExampleGenerationHook(IntrospectedTable introspectedTable, TopLevelClass topLevelClass)
introspectedTable
- topLevelClass
- protected void afterPrimaryKeyGenerationHook(IntrospectedTable introspectedTable, TopLevelClass topLevelClass)
introspectedTable
- topLevelClass
- protected void afterBaseRecordGenerationHook(IntrospectedTable introspectedTable, TopLevelClass topLevelClass)
introspectedTable
- topLevelClass
- protected void afterRecordWithBLOBsGenerationHook(IntrospectedTable introspectedTable, TopLevelClass topLevelClass)
introspectedTable
- topLevelClass
- public FullyQualifiedJavaType getPrimaryKeyType(FullyQualifiedTable table)
getPrimaryKeyType
in interface JavaModelGenerator
public FullyQualifiedJavaType getBaseRecordType(FullyQualifiedTable table)
getBaseRecordType
in interface JavaModelGenerator
table
- the table for which the name should be generated
public FullyQualifiedJavaType getRecordWithBLOBsType(FullyQualifiedTable table)
getRecordWithBLOBsType
in interface JavaModelGenerator
table
- the table for which the name should be generated
public void setWarnings(java.util.List warnings)
JavaModelGenerator
setWarnings
in interface JavaModelGenerator
protected Method getSetNullMethod(ColumnDefinition cd)
protected Method getSetNotNullMethod(ColumnDefinition cd)
protected Method getSetEqualMethod(ColumnDefinition cd)
protected Method getSetNotEqualMethod(ColumnDefinition cd)
protected Method getSetGreaterThanMethod(ColumnDefinition cd)
protected Method getSetGreaterThenOrEqualMethod(ColumnDefinition cd)
protected Method getSetLessThanMethod(ColumnDefinition cd)
protected Method getSetLessThanOrEqualMethod(ColumnDefinition cd)
protected Method getSetLikeMethod(ColumnDefinition cd)
protected Method getSetNotLikeMethod(ColumnDefinition cd)
protected Method getSingleValueMethod(ColumnDefinition cd, java.lang.String nameFragment, java.lang.String operator)
protected Method getNoValueMethod(ColumnDefinition cd, java.lang.String nameFragment, java.lang.String operator)
protected Method getSetBetweenOrNotBetweenMethod(ColumnDefinition cd, boolean betweenMethod)
cd
- betweenMethod
-
protected TopLevelClass getExample(IntrospectedTable introspectedTable)
protected InnerClass getCriteriaInnerClass(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
protected Method getSetInOrNotInMethod(ColumnDefinition cd, boolean inMethod)
cd
- inMethod
- if true generates an "in" method, else generates a "not in"
method
public void setAbatorContext(AbatorContext abatorContext)
JavaModelGenerator
setAbatorContext
in interface JavaModelGenerator
abatorContext
- The current AbatorContextprotected java.lang.String getRootClass(IntrospectedTable introspectedTable)
protected java.beans.PropertyDescriptor[] getRootClassPropertyDescriptors(java.lang.String rootClass)
protected boolean propertyExistsInRootClass(ColumnDefinition columnDefinition, java.lang.String rootClass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |