当前位置: 首页>>代码示例>>Java>>正文


Java TopLevelClass.addJavaDocLine方法代码示例

本文整理汇总了Java中org.mybatis.generator.api.dom.java.TopLevelClass.addJavaDocLine方法的典型用法代码示例。如果您正苦于以下问题:Java TopLevelClass.addJavaDocLine方法的具体用法?Java TopLevelClass.addJavaDocLine怎么用?Java TopLevelClass.addJavaDocLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mybatis.generator.api.dom.java.TopLevelClass的用法示例。


在下文中一共展示了TopLevelClass.addJavaDocLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addModelClassComment

import org.mybatis.generator.api.dom.java.TopLevelClass; //导入方法依赖的package包/类
@Override
public void addModelClassComment(TopLevelClass topLevelClass,
        IntrospectedTable introspectedTable) {
    if (suppressAllComments  || !addRemarkComments) {
        return;
    }

    StringBuilder sb = new StringBuilder();

    topLevelClass.addJavaDocLine("/**"); //$NON-NLS-1$

    String remarks = introspectedTable.getRemarks();
    if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
        topLevelClass.addJavaDocLine(" * Database Table Remarks:");
        String[] remarkLines = remarks.split(System.getProperty("line.separator"));  //$NON-NLS-1$
        for (String remarkLine : remarkLines) {
            topLevelClass.addJavaDocLine(" *   " + remarkLine);  //$NON-NLS-1$
        }
    }
    topLevelClass.addJavaDocLine(" *"); //$NON-NLS-1$

    topLevelClass
            .addJavaDocLine(" * This class was generated by MyBatis Generator."); //$NON-NLS-1$

    sb.append(" * This class corresponds to the database table "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    topLevelClass.addJavaDocLine(sb.toString());

    addJavadocTag(topLevelClass, true);

    topLevelClass.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:33,代码来源:DefaultCommentGenerator.java

示例2: addModelClassComment

import org.mybatis.generator.api.dom.java.TopLevelClass; //导入方法依赖的package包/类
@Override
public void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
    topLevelClass.addJavaDocLine("/**");
    topLevelClass.addJavaDocLine(" *");
    topLevelClass.addJavaDocLine(" * @author [email protected]");
    topLevelClass.addJavaDocLine(" * @date "+ LocalDate.now().toString());
    topLevelClass.addJavaDocLine(" *");
    topLevelClass.addJavaDocLine(" */");
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:10,代码来源:MyCommentGenerator.java

示例3: addModelClassComment

import org.mybatis.generator.api.dom.java.TopLevelClass; //导入方法依赖的package包/类
@Override
  public void addModelClassComment(TopLevelClass topLevelClass,
          IntrospectedTable introspectedTable) {
      if (suppressAllComments  || !addRemarkComments) {
          return;
      }
      //通过这种方式不能直接获取表备注
      //String remarks = introspectedTable.getRemarks();
      //重新写方法从数据库中获取表备注的信息
      String remarks = introspectedTable.getFullyQualifiedTable().getRemark();
      //获取实体类名称
      String entityName = introspectedTable.getFullyQualifiedTable().getDomainObjectName();
      StringBuilder sb = new StringBuilder();
      
      //添加导入类的信息
topLevelClass.addJavaDocLine("import org.springframework.format.annotation.DateTimeFormat;"); 
topLevelClass.addJavaDocLine("import com.fasterxml.jackson.annotation.JsonFormat;");
topLevelClass.addJavaDocLine("import io.swagger.annotations.ApiModel;");
topLevelClass.addJavaDocLine("import io.swagger.annotations.ApiModelProperty;");
      
      //添加类注释
      topLevelClass.addJavaDocLine("/**"); 
      sb.append(" * "+ remarks); 
      sb.append("\n");
      sb.append(" * 实体类对应的数据表为:  "); 
sb.append(introspectedTable.getFullyQualifiedTable());
topLevelClass.addJavaDocLine(sb.toString());
topLevelClass.addJavaDocLine(" * @author " + author);

//添加时间
topLevelClass.addJavaDocLine(" * @date " + getDateString());
topLevelClass.addJavaDocLine(" */");
topLevelClass.addJavaDocLine("@ApiModel(value =\"" + entityName + "\")");
      

      /*topLevelClass.addJavaDocLine("/**"); 
      if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
          topLevelClass.addJavaDocLine(" * Database Table Remarks:");
          String[] remarkLines = remarks.split(System.getProperty("line.separator"));  
          for (String remarkLine : remarkLines) {
              topLevelClass.addJavaDocLine(" *   " + remarkLine);  
          }
      }
      topLevelClass.addJavaDocLine(" *"); 

      topLevelClass
              .addJavaDocLine(" * This class was generated by MyBatis Generator."); 

      sb.append(" * This class corresponds to the database table "); 
      sb.append(introspectedTable.getFullyQualifiedTable());
      topLevelClass.addJavaDocLine(sb.toString());

      addJavadocTag(topLevelClass, true); */

      //topLevelClass.addJavaDocLine(" */");
  }
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:57,代码来源:DefaultCommentGenerator.java


注:本文中的org.mybatis.generator.api.dom.java.TopLevelClass.addJavaDocLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。