类 TemplateCommentGenerator

  • 所有已实现的接口:
    org.mybatis.generator.api.CommentGenerator

    public class TemplateCommentGenerator
    extends Object
    implements org.mybatis.generator.api.CommentGenerator
    --------------------------------------------------------------------------- 模板注释生成工具 --------------------------------------------------------------------------- ---------------------------------------------------------------------------
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected static org.slf4j.Logger logger  
    • 构造器概要

      构造器 
      构造器 说明
      TemplateCommentGenerator​(org.mybatis.generator.config.Context context, String templatePath)
      构造函数
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      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)  
      void addClassComment​(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)
      Adds the inner class comment.
      void addClassComment​(org.mybatis.generator.api.dom.java.InnerClass innerClass, org.mybatis.generator.api.IntrospectedTable introspectedTable, boolean markAsDoNotDelete)
      Adds the inner class comment.
      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.
      void addConfigurationProperties​(Properties properties)
      Adds properties for this instance from any properties configured in the CommentGenerator configuration.
      void addEnumComment​(org.mybatis.generator.api.dom.java.InnerEnum innerEnum, org.mybatis.generator.api.IntrospectedTable introspectedTable)
      Adds the enum comment.
      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)  
      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)  
      void addFieldComment​(org.mybatis.generator.api.dom.java.Field field, org.mybatis.generator.api.IntrospectedTable introspectedTable)
      Adds the field comment.
      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.
      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)  
      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)  
      void addGeneralMethodComment​(org.mybatis.generator.api.dom.java.Method method, org.mybatis.generator.api.IntrospectedTable introspectedTable)
      Adds the general method comment.
      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.
      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.
      void addModelClassComment​(org.mybatis.generator.api.dom.java.TopLevelClass topLevelClass, org.mybatis.generator.api.IntrospectedTable introspectedTable)
      Adds a comment for a model class.
      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.
      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.
      • 从接口继承的方法 org.mybatis.generator.api.CommentGenerator

        addFileComment, addGeneralFunctionComment, addGeneralPropertyComment, addModelClassComment
    • 字段详细资料

      • logger

        protected static final org.slf4j.Logger logger
    • 构造器详细资料

      • 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 field
        introspectedTable - the introspected table
        introspectedColumn - 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 field
        introspectedTable - 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 class
        introspectedTable - 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 class
        introspectedTable - 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 class
        introspectedTable - the introspected table
        markAsDoNotDelete - 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 enum
        introspectedTable - 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 method
        introspectedTable - the introspected table
        introspectedColumn - 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 method
        introspectedTable - the introspected table
        introspectedColumn - 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 method
        introspectedTable - 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