修复ConvertFactory.registerIgnoreAll方法出现不生效的bug

This commit is contained in:
Redkale
2019-04-04 22:20:16 +08:00
parent d3e8675948
commit 737c4a92b9
2 changed files with 10 additions and 2 deletions

View File

@@ -89,4 +89,9 @@ public final class ConvertColumnEntry {
this.index = index;
}
@Override
public String toString() {
return "ConvertColumnEntry{" + "index=" + index + ", name=" + name + ", ignore=" + ignore + ", convertType=" + convertType + '}';
}
}

View File

@@ -251,8 +251,8 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
}
for (ConvertColumn ref : ccs) {
if (ref.type().contains(ct)) {
String realName = ref.name().isEmpty() ? fieldName : ref.name();
if (onlyColumns != null && fieldName != null) {
String realName = ref.name().isEmpty() ? fieldName : ref.name();
if (!onlyColumns.contains(realName)) return new ConvertColumnEntry(realName, true);
}
ConvertColumnEntry entry = new ConvertColumnEntry(ref);
@@ -260,7 +260,10 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
entry.setIgnore(false);
return entry;
}
if (skipIgnores.isEmpty()) return entry;
if (skipIgnores.isEmpty()) {
if (onlyColumns != null && realName != null && onlyColumns.contains(realName)) entry.setIgnore(false);
return entry;
}
if (skipIgnores.contains(((Member) element).getDeclaringClass())) entry.setIgnore(false);
return entry;
}