本文整理汇总了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$
}
示例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(" */");
}
示例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(" */");
}