com.github.ofofs.plugins.FileHeaderPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugins Show documentation
Show all versions of plugins Show documentation
Mybatis Generator Lombok Plugin
The newest version!
package com.github.ofofs.plugins;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.TopLevelClass;
import java.util.List;
/**
* @author kyg
*/
public class FileHeaderPlugin extends PluginAdapter {
public boolean validate(List warnings) {
return true;
}
@Override
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
genJavaDocs(topLevelClass.getJavaDocLines());
return true;
}
@Override
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
genJavaDocs(interfaze.getJavaDocLines());
return true;
}
/**
* 生成Java文档注释
*
* @param javaDocLines
*/
private void genJavaDocs(List javaDocLines) {
javaDocLines.add("/**");
javaDocLines.add(" * @author " + properties.getProperty("author", "mbg"));
javaDocLines.add(" */");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy