public class DefaultCommentGenerator extends Object implements CommentGenerator
| Constructor and Description |
|---|
DefaultCommentGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClassAnnotation(InnerClass innerClass,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a class.
|
void |
addClassComment(InnerClass innerClass,
IntrospectedTable introspectedTable)
Adds the inner class comment.
|
void |
addClassComment(InnerClass innerClass,
IntrospectedTable introspectedTable,
boolean markAsDoNotDelete)
Adds the inner class comment.
|
void |
addComment(XmlElement xmlElement)
Adds a suitable comment to warn users that the element was generated, and
when it was generated.
|
void |
addConfigurationProperties(Properties props)
Adds properties for this instance from any properties configured in the
CommentGenerator configuration.
|
void |
addEnumComment(InnerEnum innerEnum,
IntrospectedTable introspectedTable)
Adds the enum comment.
|
void |
addFieldAnnotation(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a field.
|
void |
addFieldAnnotation(Field field,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a field.
|
void |
addFieldComment(Field field,
IntrospectedTable introspectedTable)
Adds the field comment.
|
void |
addFieldComment(Field field,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
This method should add a Javadoc comment to the specified field.
|
void |
addFileComment(KotlinFile kotlinFile)
This method is called to add a file level comment to a generated Kotlin file.
|
void |
addGeneralMethodAnnotation(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a method.
|
void |
addGeneralMethodAnnotation(Method method,
IntrospectedTable introspectedTable,
Set<FullyQualifiedJavaType> imports)
Adds a @Generated annotation to a method.
|
void |
addGeneralMethodComment(Method method,
IntrospectedTable introspectedTable)
Adds the general method comment.
|
void |
addGetterComment(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
Adds the getter comment.
|
protected void |
addJavadocTag(JavaElement javaElement,
boolean markAsDoNotDelete)
This method adds the custom javadoc tag for.
|
void |
addModelClassComment(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
Adds a comment for a model class.
|
void |
addSetterComment(Method method,
IntrospectedTable introspectedTable,
IntrospectedColumn introspectedColumn)
Adds the setter comment.
|
protected String |
getDateString()
Returns a formated date string to include in the Javadoc tag and XML
comments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddGeneralFunctionComment, addGeneralPropertyComment, addJavaFileComment, addModelClassComment, addRootCommentpublic void addComment(XmlElement xmlElement)
addComment in interface CommentGeneratorxmlElement - the xml elementpublic void addConfigurationProperties(Properties props)
CommentGeneratorThis method will be called before any of the other methods.
addConfigurationProperties in interface CommentGeneratorprops - All properties from the configurationprotected void addJavadocTag(JavaElement javaElement, boolean markAsDoNotDelete)
javaElement - the java elementmarkAsDoNotDelete - the mark as do not deleteprotected String getDateString()
public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable)
CommentGeneratoraddClassComment in interface CommentGeneratorinnerClass - the inner classintrospectedTable - the introspected tablepublic void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean markAsDoNotDelete)
CommentGeneratoraddClassComment in interface CommentGeneratorinnerClass - the inner classintrospectedTable - the introspected tablemarkAsDoNotDelete - the mark as do not deletepublic void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable)
CommentGeneratorBecause of difficulties with the Java file merger, the default implementation of this method should NOT add comments. Comments should only be added if specifically requested by the user (for example, by enabling table remark comments).
addModelClassComment in interface CommentGeneratortopLevelClass - the top level classintrospectedTable - the introspected tablepublic void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable)
CommentGeneratoraddEnumComment in interface CommentGeneratorinnerEnum - the inner enumintrospectedTable - the introspected tablepublic void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
CommentGeneratorImportant: This method should add a the nonstandard JavaDoc tag "@mbg.generated" to the comment. Without this tag, the Eclipse based Java merge feature will fail.
addFieldComment in interface CommentGeneratorfield - the fieldintrospectedTable - the introspected tableintrospectedColumn - the introspected columnpublic void addFieldComment(Field field, IntrospectedTable introspectedTable)
CommentGeneratoraddFieldComment in interface CommentGeneratorfield - the fieldintrospectedTable - the introspected tablepublic void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable)
CommentGeneratoraddGeneralMethodComment in interface CommentGeneratormethod - the methodintrospectedTable - the introspected tablepublic void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
CommentGeneratoraddGetterComment in interface CommentGeneratormethod - the methodintrospectedTable - the introspected tableintrospectedColumn - the introspected columnpublic void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn)
CommentGeneratoraddSetterComment in interface CommentGeneratormethod - the methodintrospectedTable - the introspected tableintrospectedColumn - the introspected columnpublic void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
CommentGeneratoraddGeneralMethodAnnotation in interface CommentGeneratormethod - the methodintrospectedTable - the introspected tableimports - the comment generator may add a required imported type to this listpublic void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn, Set<FullyQualifiedJavaType> imports)
CommentGeneratoraddGeneralMethodAnnotation in interface CommentGeneratormethod - the methodintrospectedTable - the introspected tableintrospectedColumn - thr introspected columnimports - the comment generator may add a required imported type to this listpublic void addFieldAnnotation(Field field, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
CommentGeneratoraddFieldAnnotation in interface CommentGeneratorfield - the fieldintrospectedTable - the introspected tableimports - the comment generator may add a required imported type to this listpublic void addFieldAnnotation(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn, Set<FullyQualifiedJavaType> imports)
CommentGeneratoraddFieldAnnotation in interface CommentGeneratorfield - the fieldintrospectedTable - the introspected tableintrospectedColumn - the introspected columnimports - the comment generator may add a required imported type to this listpublic void addClassAnnotation(InnerClass innerClass, IntrospectedTable introspectedTable, Set<FullyQualifiedJavaType> imports)
CommentGeneratoraddClassAnnotation in interface CommentGeneratorinnerClass - the classintrospectedTable - the introspected tableimports - the comment generator may add a required imported type to this listpublic void addFileComment(KotlinFile kotlinFile)
CommentGeneratorThe default implementation does nothing.
addFileComment in interface CommentGeneratorkotlinFile - the Kotlin fileCopyright © 2006–2025 MyBatis.org. All rights reserved.