mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
add enable
This commit is contained in:
parent
5c587a3bfe
commit
6947d89697
@ -56,6 +56,9 @@ public class EntityProcessor extends AbstractProcessor {
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
if (!roundEnv.processingOver()) {
|
||||
if (!globalConf.isEnable()) {
|
||||
return false;
|
||||
}
|
||||
Set<? extends Element> tables = roundEnv.getRootElements().stream().filter(i -> {
|
||||
List<? extends AnnotationMirror> mirrors = i.getAnnotationMirrors();
|
||||
if (mirrors != null && !mirrors.isEmpty()) {
|
||||
|
@ -23,6 +23,7 @@ public class Conf {
|
||||
private String tablesClassName = "%S";
|
||||
private boolean cache = true;
|
||||
|
||||
private boolean enable = true;
|
||||
private String scanAnno = "";
|
||||
private String scanPackage = "";
|
||||
|
||||
@ -37,6 +38,7 @@ public class Conf {
|
||||
this.initFlag = conf.initFlag;
|
||||
this.cache = conf.cache;
|
||||
|
||||
this.enable = conf.enable;
|
||||
this.scanAnno = conf.scanAnno;
|
||||
this.scanPackage = conf.scanPackage;
|
||||
}
|
||||
@ -81,6 +83,7 @@ public class Conf {
|
||||
this.tablasClassPackage = properties.getOrDefault("tablasClassPackage", this.tablasClassPackage).toString();
|
||||
this.tablesClassName = properties.getOrDefault("tablesClassName", this.tablesClassName).toString();
|
||||
this.cache = Boolean.parseBoolean(properties.getOrDefault("cache", this.cache).toString());
|
||||
this.enable = Boolean.parseBoolean(properties.getOrDefault("enable", this.enable).toString());
|
||||
this.scanAnno = properties.getOrDefault("scanAnno", this.scanAnno).toString();
|
||||
this.scanPackage = properties.getOrDefault("scanPackage", this.scanPackage).toString();
|
||||
}
|
||||
@ -150,6 +153,10 @@ public class Conf {
|
||||
return scanPackage;
|
||||
}
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public enum ConfItem {
|
||||
className("value", (c, v) -> c.setClassName(v.toString())),
|
||||
packageName("classPackage", (c, v) -> c.setClassPackage(v.toString())),
|
||||
|
Loading…
x
Reference in New Issue
Block a user