Skip to content

Commit 446bd6d

Browse files
committed
refactor: 兼容jdk17,去掉javax包的相关引用
1 parent 1a6c30d commit 446bd6d

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/main/java/com/github/davidfantasy/mybatisplus/generatorui/mbp/BeetlTemplateEngine.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.beetl.core.resource.FileResourceLoader;
1616
import org.beetl.core.resource.StartsWithMatcher;
1717

18-
import javax.annotation.Nonnull;
1918
import java.io.ByteArrayOutputStream;
2019
import java.io.File;
2120
import java.io.FileOutputStream;
@@ -56,7 +55,7 @@ public BeetlTemplateEngine(NameConverter nameConverter, String templateStoreDir)
5655
}
5756

5857
@Override
59-
public void writer(@Nonnull Map<String, Object> objectMap, String templatePath, @Nonnull File outputFile) throws Exception {
58+
public void writer(Map<String, Object> objectMap, String templatePath, File outputFile) throws Exception {
6059
if (templatePath.startsWith(RESOURCE_PREFIX_FILE)) {
6160
templatePath = templatePath.replace(templateStoreDir, "");
6261
}
@@ -70,15 +69,13 @@ public void writer(@Nonnull Map<String, Object> objectMap, String templatePath,
7069
}
7170

7271
@Override
73-
@Nonnull
74-
public AbstractTemplateEngine init(@Nonnull ConfigBuilder configBuilder) {
72+
public AbstractTemplateEngine init(ConfigBuilder configBuilder) {
7573
return this;
7674
}
7775

7876

7977
@Override
80-
@Nonnull
81-
public String templateFilePath(@Nonnull String filePath) {
78+
public String templateFilePath(String filePath) {
8279
return filePath;
8380
}
8481

@@ -98,7 +95,7 @@ public String write2String(Map<String, Object> objectMap, String templatePath) {
9895
}
9996

10097
@Override
101-
protected void outputCustomFile(List<CustomFile> customFiles, TableInfo tableInfo, @Nonnull Map<String, Object> objectMap) {
98+
protected void outputCustomFile(List<CustomFile> customFiles, TableInfo tableInfo, Map<String, Object> objectMap) {
10299
String entityName = tableInfo.getEntityName();
103100
String parentPath = getPathInfo(OutputFile.parent);
104101
customFiles.forEach(file -> {

src/main/java/com/github/davidfantasy/mybatisplus/generatorui/mbp/MbpGenerator.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.springframework.beans.factory.annotation.Autowired;
2727
import org.springframework.stereotype.Component;
2828

29-
import javax.annotation.Nonnull;
3029
import java.io.File;
3130
import java.util.*;
3231

@@ -204,14 +203,12 @@ private void configEntity(Entity.Builder entityBuilder, EntityStrategy entityStr
204203
entityBuilder.idType(generatorConfig.getIdType());
205204
entityBuilder.nameConvert(new INameConvert() {
206205
@Override
207-
@Nonnull
208-
public String entityNameConvert(@Nonnull TableInfo tableInfo) {
206+
public String entityNameConvert(TableInfo tableInfo) {
209207
return nameConverter.entityNameConvert(tableInfo.getName(), generatorConfig.getTablePrefix());
210208
}
211209

212210
@Override
213-
@Nonnull
214-
public String propertyNameConvert(@Nonnull TableField field) {
211+
public String propertyNameConvert(TableField field) {
215212
return nameConverter.propertyNameConvert(field.getName());
216213
}
217214
});

0 commit comments

Comments
 (0)