This commit is contained in:
@@ -201,6 +201,17 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
|
|||||||
this.skipAllIgnore = skipIgnore;
|
this.skipAllIgnore = skipIgnore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使所有类的所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
|
||||||
|
*
|
||||||
|
* @param skipIgnore
|
||||||
|
* @return 自身
|
||||||
|
*/
|
||||||
|
public ConvertFactory<R, W> skipAllIgnore(final boolean skipIgnore) {
|
||||||
|
this.skipAllIgnore = skipIgnore;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使该类所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
|
* 使该类所有被声明为ConvertColumn.ignore = true 的字段或方法变为ConvertColumn.ignore = false
|
||||||
*
|
*
|
||||||
@@ -215,11 +226,11 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
|
|||||||
register(type, column, new ConvertColumnEntry(column, ignore));
|
register(type, column, new ConvertColumnEntry(column, ignore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean register(final Class type, String column, String alias) {
|
public final boolean register(final Class type, String column, String alias) {
|
||||||
return register(type, column, new ConvertColumnEntry(alias));
|
return register(type, column, new ConvertColumnEntry(alias));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean register(final Class type, String column, ConvertColumnEntry entry) {
|
public final boolean register(final Class type, String column, ConvertColumnEntry entry) {
|
||||||
if (type == null || column == null || entry == null) return false;
|
if (type == null || column == null || entry == null) return false;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ public final class BsonFactory extends ConvertFactory<BsonReader, BsonWriter> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BsonFactory skipAllIgnore(final boolean skipIgnore) {
|
||||||
|
this.registerSkipAllIgnore(skipIgnore);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public static BsonFactory root() {
|
public static BsonFactory root() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ public final class JsonFactory extends ConvertFactory<JsonReader, JsonWriter> {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonFactory skipAllIgnore(final boolean skipIgnore) {
|
||||||
|
this.registerSkipAllIgnore(skipIgnore);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public static JsonFactory root() {
|
public static JsonFactory root() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user