类 TemplateCommentGenerator
- java.lang.Object
-
- pro.leaco.mybatis.generator.plugins.utils.enhanced.TemplateCommentGenerator
-
- 所有已实现的接口:
org.mybatis.generator.api.CommentGenerator
public class TemplateCommentGenerator extends Object implements org.mybatis.generator.api.CommentGenerator
--------------------------------------------------------------------------- 模板注释生成工具 --------------------------------------------------------------------------- ---------------------------------------------------------------------------
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classTemplateCommentGenerator.EnumNode评论模板节点ID
-
字段概要
字段 修饰符和类型 字段 说明 protected static org.slf4j.Loggerlogger
-
构造器概要
构造器 构造器 说明 TemplateCommentGenerator(org.mybatis.generator.config.Context context, String templatePath)构造函数
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddClassAnnotation(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)voidaddClassComment(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the inner class comment.voidaddClassComment(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable, boolean markAsDoNotDelete)Adds the inner class comment.voidaddComment(org.mybatis.generator.api.dom.xml.XmlElement xmlElement)This method should add a suitable comment as a child element of the specified xmlElement to warn users that the element was generated and is subject to regeneration.voidaddConfigurationProperties(Properties properties)Adds properties for this instance from any properties configured in the CommentGenerator configuration.voidaddEnumComment(org.mybatis.generator.api.dom.java.InnerEnum innerEnum, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the enum comment.voidaddFieldAnnotation(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)voidaddFieldAnnotation(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)voidaddFieldComment(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the field comment.voidaddFieldComment(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)This method should add a Javadoc comment to the specified field.voidaddGeneralMethodAnnotation(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)voidaddGeneralMethodAnnotation(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)voidaddGeneralMethodComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the general method comment.voidaddGetterComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)Adds the getter comment.voidaddJavaFileComment(org.mybatis.generator.api.dom.java.CompilationUnit compilationUnit)This method is called to add a file level comment to a generated java file.voidaddModelClassComment(org.mybatis.generator.api.dom.java.TopLevelClass topLevelClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds a comment for a model class.voidaddRootComment(org.mybatis.generator.api.dom.xml.XmlElement rootElement)This method is called to add a comment as the first child of the root element.voidaddSetterComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)Adds the setter comment.
-
-
-
构造器详细资料
-
TemplateCommentGenerator
public TemplateCommentGenerator(org.mybatis.generator.config.Context context, String templatePath)构造函数- 参数:
context-templatePath- 模板路径
-
-
方法详细资料
-
addConfigurationProperties
public void addConfigurationProperties(Properties properties)
Adds properties for this instance from any properties configured in the CommentGenerator configuration.This method will be called before any of the other methods.
- 指定者:
addConfigurationProperties在接口中org.mybatis.generator.api.CommentGenerator- 参数:
properties- All properties from the configuration
-
addFieldComment
public void addFieldComment(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)This method should add a Javadoc comment to the specified field. The field is related to the specified table and is used to hold the value of the specified column.Important: 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在接口中org.mybatis.generator.api.CommentGenerator- 参数:
field- the fieldintrospectedTable- the introspected tableintrospectedColumn- the introspected column
-
addFieldComment
public void addFieldComment(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the field comment.- 指定者:
addFieldComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
field- the fieldintrospectedTable- the introspected table
-
addModelClassComment
public void addModelClassComment(org.mybatis.generator.api.dom.java.TopLevelClass topLevelClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds a comment for a model class. The Java code merger should be notified not to delete the entire class in case any manual changes have been made. So this method will always use the "do not delete" annotation.Because 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在接口中org.mybatis.generator.api.CommentGenerator- 参数:
topLevelClass- the top level classintrospectedTable- the introspected table
-
addClassComment
public void addClassComment(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the inner class comment.- 指定者:
addClassComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
innerClass- the inner classintrospectedTable- the introspected table
-
addClassComment
public void addClassComment(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable, boolean markAsDoNotDelete)Adds the inner class comment.- 指定者:
addClassComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
innerClass- the inner classintrospectedTable- the introspected tablemarkAsDoNotDelete- the mark as do not delete
-
addEnumComment
public void addEnumComment(org.mybatis.generator.api.dom.java.InnerEnum innerEnum, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the enum comment.- 指定者:
addEnumComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
innerEnum- the inner enumintrospectedTable- the introspected table
-
addGetterComment
public void addGetterComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)Adds the getter comment.- 指定者:
addGetterComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
method- the methodintrospectedTable- the introspected tableintrospectedColumn- the introspected column
-
addSetterComment
public void addSetterComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn)Adds the setter comment.- 指定者:
addSetterComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
method- the methodintrospectedTable- the introspected tableintrospectedColumn- the introspected column
-
addGeneralMethodComment
public void addGeneralMethodComment(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable)Adds the general method comment.- 指定者:
addGeneralMethodComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
method- the methodintrospectedTable- the introspected table
-
addJavaFileComment
public void addJavaFileComment(org.mybatis.generator.api.dom.java.CompilationUnit compilationUnit)
This method is called to add a file level comment to a generated java file. This method could be used to add a general file comment (such as a copyright notice). However, note that the Java file merge function in Eclipse does not deal with this comment. If you run the generator repeatedly, you will only retain the comment from the initial run.The default implementation does nothing.
- 指定者:
addJavaFileComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
compilationUnit- the compilation unit
-
addComment
public void addComment(org.mybatis.generator.api.dom.xml.XmlElement xmlElement)
This method should add a suitable comment as a child element of the specified xmlElement to warn users that the element was generated and is subject to regeneration.- 指定者:
addComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
xmlElement- the xml element
-
addRootComment
public void addRootComment(org.mybatis.generator.api.dom.xml.XmlElement rootElement)
This method is called to add a comment as the first child of the root element. This method could be used to add a general file comment (such as a copyright notice). However, note that the XML file merge function does not deal with this comment. If you run the generator repeatedly, you will only retain the comment from the initial run.The default implementation does nothing.
- 指定者:
addRootComment在接口中org.mybatis.generator.api.CommentGenerator- 参数:
rootElement- the root element
-
addGeneralMethodAnnotation
public void addGeneralMethodAnnotation(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)- 指定者:
addGeneralMethodAnnotation在接口中org.mybatis.generator.api.CommentGenerator
-
addGeneralMethodAnnotation
public void addGeneralMethodAnnotation(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)- 指定者:
addGeneralMethodAnnotation在接口中org.mybatis.generator.api.CommentGenerator
-
addFieldAnnotation
public void addFieldAnnotation(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)- 指定者:
addFieldAnnotation在接口中org.mybatis.generator.api.CommentGenerator
-
addFieldAnnotation
public void addFieldAnnotation(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable, org.mybatis.generator.api.IntrospectedColumn introspectedColumn, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)- 指定者:
addFieldAnnotation在接口中org.mybatis.generator.api.CommentGenerator
-
addClassAnnotation
public void addClassAnnotation(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable, Set<org.mybatis.generator.api.dom.java.FullyQualifiedJavaType> imports)- 指定者:
addClassAnnotation在接口中org.mybatis.generator.api.CommentGenerator
-
-