org.mybatis.generator.api.dom.java.Method.addJavaDocLine()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(13.8k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中org.mybatis.generator.api.dom.java.Method.addJavaDocLine()方法的一些代码示例,展示了Method.addJavaDocLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.addJavaDocLine()方法的具体详情如下:
包路径:org.mybatis.generator.api.dom.java.Method
类名称:Method
方法名:addJavaDocLine

Method.addJavaDocLine介绍

暂无

代码示例

代码示例来源:origin: abel533/Mapper

/**
 * getter方法注释
 *
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**");
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" * 获取");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" *");
  }
  sb.setLength(0);
  sb.append(" * @return ");
  sb.append(introspectedColumn.getActualColumnName());
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" - ");
    sb.append(introspectedColumn.getRemarks());
  }
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" */");
}

代码示例来源:origin: abel533/Mapper

/**
 * setter方法注释
 *
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**");
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" * 设置");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" *");
  }
  Parameter parm = method.getParameters().get(0);
  sb.setLength(0);
  sb.append(" * @param ");
  sb.append(parm.getName());
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" ");
    sb.append(introspectedColumn.getRemarks());
  }
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" */");
}

代码示例来源:origin: abel533/Mapper

/**
 * getter方法注释
 *
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**");
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" * 获取");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" *");
  }
  sb.setLength(0);
  sb.append(" * @return ");
  sb.append(introspectedColumn.getActualColumnName());
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" - ");
    sb.append(introspectedColumn.getRemarks());
  }
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" */");
}

代码示例来源:origin: abel533/Mapper

/**
 * setter方法注释
 *
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**");
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" * 设置");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" *");
  }
  Parameter parm = method.getParameters().get(0);
  sb.setLength(0);
  sb.append(" * @param ");
  sb.append(parm.getName());
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" ");
    sb.append(introspectedColumn.getRemarks());
  }
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" */");
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addMethodComment(Method method, String doc, String paramName) {
    StringBuilder sb = new StringBuilder();
    if (doc != null && doc.length() != 0) {
      method.addJavaDocLine("/**");
      sb.append(" * ");
      doc = doc.replaceAll(OutputUtilities.lineSeparator, "<br>" + OutputUtilities.lineSeparator + "\t * ");
      sb.append(doc);
      method.addJavaDocLine(sb.toString());
      method.addJavaDocLine(" */");
    }
  }
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addSetterComment(Method method, String doc, String paramName) {
  StringBuilder sb = new StringBuilder();
  if (doc != null && doc.length() != 0) {
    method.addJavaDocLine("/**");
    sb.append(" * @param " + paramName + " ");
    // doc = doc.replaceAll(OutputUtilities.lineSeparator, "<br>" + OutputUtilities.lineSeparator + "\t * ");
    sb.append(doc);
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */");
  }
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addGetterComment(Method method, String doc, String paramName) {
  StringBuilder sb = new StringBuilder();
  if (doc != null && doc.length() != 0) {
    method.addJavaDocLine("/**");
    sb.append(" * @return ");
    doc = doc.replaceAll(OutputUtilities.lineSeparator, "<br>" + OutputUtilities.lineSeparator + "\t * ");
    sb.append(doc);
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */");
  }
}

代码示例来源:origin: caojx-git/learn

/**
 * 普通方法的注释,这里主要是XXXMapper.java里面的接口方法的注释
 * @param method
 * @param introspectedTable
 */
@Override
public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable) {
  if (suppressAllComments) {
    return;
  }
  method.addJavaDocLine("/**");
  addJavadocTag(method, false);
  method.addJavaDocLine(" */");
}

代码示例来源:origin: caojx-git/learn

/**
 * 普通方法的注释,这里主要是XXXMapper.java里面的接口方法的注释
 * @param method
 * @param introspectedTable
 */
@Override
public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable) {
  if (suppressAllComments) {
    return;
  }
  method.addJavaDocLine("/**");
  addJavadocTag(method, false);
  method.addJavaDocLine(" */");
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**"); //$NON-NLS-1$
  method.addJavaDocLine(" * This method was generated by MyBatis Generator."); //$NON-NLS-1$
  sb.append(" * This method corresponds to the database table "); //$NON-NLS-1$
  sb.append(introspectedTable.getFullyQualifiedTable());
  method.addJavaDocLine(sb.toString());
  addJavadocTag(method, false);
  method.addJavaDocLine(" */"); //$NON-NLS-1$
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable, String comments) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  String remark = comments;
  if (remark != null && remark.length() != 0) {
    method.addJavaDocLine("/**"); //$NON-NLS-1$
    sb.append(" * "); //$NON-NLS-1$
    remark = remark.replaceAll(OutputUtilities.lineSeparator,
        "<br>" + OutputUtilities.lineSeparator + "\t * ");
    sb.append(remark);
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */"); //$NON-NLS-1$
  }
}

代码示例来源:origin: handosme/mybatis-generator-plus

public void addGeneralMethodComment(Method method,
    IntrospectedTable introspectedTable) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**"); //$NON-NLS-1$
  method
      .addJavaDocLine(" * This method was generated by MyBatis Generator."); //$NON-NLS-1$
  sb.append(" * This method corresponds to the database table "); //$NON-NLS-1$
  sb.append(introspectedTable.getFullyQualifiedTable());
  method.addJavaDocLine(sb.toString());
  addJavadocTag(method, false);
  method.addJavaDocLine(" */"); //$NON-NLS-1$
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addGetterComment(Method method, IntrospectedTable introspectedTable,
    IntrospectedColumn introspectedColumn) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  String remark = introspectedColumn.getRemarks();
  if (remark != null && remark.length() != 0) {
    method.addJavaDocLine("/**");
    sb.append(" * @return ");
    remark = remark.replaceAll(OutputUtilities.lineSeparator,
        "<br>" + OutputUtilities.lineSeparator + "\t *         ");
    sb.append(remark);
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */");
  }
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addGeneralMethodComment(Method method,
    IntrospectedTable introspectedTable) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**"); //$NON-NLS-1$
  method
      .addJavaDocLine(" * This method was generated by MyBatis Generator."); //$NON-NLS-1$
  sb.append(" * This method corresponds to the database table "); //$NON-NLS-1$
  sb.append(introspectedTable.getFullyQualifiedTable());
  method.addJavaDocLine(sb.toString());
  addJavadocTag(method, false);
  method.addJavaDocLine(" */"); //$NON-NLS-1$
}

代码示例来源:origin: cxjava/mybatis-generator-core

public void addSetterComment(Method method, IntrospectedTable introspectedTable,
    IntrospectedColumn introspectedColumn) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  String remark = introspectedColumn.getRemarks();
  if (remark != null && remark.length() != 0) {
    method.addJavaDocLine("/**");
    sb.append(" * @param " + JavaBeansUtil.getCamelCaseString(introspectedColumn.getActualColumnName(), false) + " "); //$NON-NLS-1$
    remark = remark.replaceAll(OutputUtilities.lineSeparator,
        "<br>" + OutputUtilities.lineSeparator + "\t *            ");
    sb.append("" + OutputUtilities.lineSeparator + "\t *            " + remark);
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */"); //$NON-NLS-1$
  }
}

代码示例来源:origin: caojx-git/learn

/**
 *  给getter方法加注释
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addGetterComment(Method method, IntrospectedTable introspectedTable,IntrospectedColumn introspectedColumn) {
  if (suppressAllComments) {
    return;
  }
  method.addJavaDocLine("/**");
  StringBuilder sb = new StringBuilder();
  sb.append(" * ");
  sb.append(introspectedColumn.getRemarks());
  method.addJavaDocLine(sb.toString().replace("\n", " "));
  sb.setLength(0);
  sb.append(" * @return ");
  sb.append(introspectedColumn.getActualColumnName());
  sb.append(" ");
  sb.append(introspectedColumn.getRemarks());
  method.addJavaDocLine(sb.toString().replace("\n", " "));
  method.addJavaDocLine(" */");
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

public void addGetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  if (suppressAllComments) {
    return;
  }
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**"); //$NON-NLS-1$
  method.addJavaDocLine(" * This method was generated by MyBatis Generator."); //$NON-NLS-1$
  sb.append(" * This method returns the value of the database column "); //$NON-NLS-1$
  sb.append(introspectedTable.getFullyQualifiedTable());
  sb.append('.');
  sb.append(introspectedColumn.getActualColumnName());
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" *"); //$NON-NLS-1$
  sb.setLength(0);
  sb.append(" * @return the value of "); //$NON-NLS-1$
  sb.append(introspectedTable.getFullyQualifiedTable());
  sb.append('.');
  sb.append(introspectedColumn.getActualColumnName());
  method.addJavaDocLine(sb.toString());
  addJavadocTag(method, false);
  method.addJavaDocLine(" */"); //$NON-NLS-1$
}

代码示例来源:origin: caojx-git/learn

/**
 *  给setter方法加注释
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
@Override
public void addSetterComment(Method method, IntrospectedTable introspectedTable,IntrospectedColumn introspectedColumn) {
  if (suppressAllComments) {
    return;
  }
  method.addJavaDocLine("/**");
  StringBuilder sb = new StringBuilder();
  sb.append(" * ");
  sb.append(introspectedColumn.getRemarks());
  method.addJavaDocLine(sb.toString().replace("\n", " "));
  Parameter parm = method.getParameters().get(0);
  sb.setLength(0);
  sb.append(" * @param ");
  sb.append(parm.getName());
  sb.append(" ");
  sb.append(introspectedColumn.getRemarks());
  method.addJavaDocLine(sb.toString().replace("\n", " "));
  method.addJavaDocLine(" */");
}

代码示例来源:origin: vakinge/jeesuite-libs

/**
 * setter方法注释
 *
 * @param method
 * @param introspectedTable
 * @param introspectedColumn
 */
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
  StringBuilder sb = new StringBuilder();
  method.addJavaDocLine("/**");
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" * 设置");
    sb.append(introspectedColumn.getRemarks());
    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" *");
  }
  Parameter parm = method.getParameters().get(0);
  sb.setLength(0);
  sb.append(" * @param ");
  sb.append(parm.getName());
  if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
    sb.append(" ");
    sb.append(introspectedColumn.getRemarks());
  }
  method.addJavaDocLine(sb.toString());
  method.addJavaDocLine(" */");
}

代码示例来源:origin: dcendents/mybatis-generator-plugins

void addGenericMethod(Method method, FullyQualifiedJavaType returnType, FullyQualifiedJavaType... types) {
  method.addAnnotation("@Override");
  if (!methodsAdded.contains(method.getName())) {
    Method genericMethod = new Method(method.getName());
    genericMethod.addJavaDocLine("/**");
    genericMethod.addJavaDocLine(" * This method was generated by MyBatis Generator.");
    genericMethod.addJavaDocLine(" *");
    genericMethod.addJavaDocLine(" * @mbg.generated");
    genericMethod.addJavaDocLine(" */");
    genericMethod.setReturnType(returnType);
    for (int i = 0; i < method.getParameters().size(); i++) {
      Parameter parameter = method.getParameters().get(i);
      FullyQualifiedJavaType paramType = types.length > i ? types[i] : parameter.getType();
      Parameter genericParameter = new Parameter(paramType, parameter.getName());
      genericMethod.addParameter(genericParameter);
    }
    genericInterface.addMethod(genericMethod);
    methodsAdded.add(method.getName());
  }
}

相关文章