This commit is contained in:
@@ -65,6 +65,10 @@ public final class EnMember<W extends Writer, T, F> {
|
||||
return attribute.field().equals(name);
|
||||
}
|
||||
|
||||
public Attribute<T, F> getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package org.redkale.convert;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
import org.redkale.util.Attribute;
|
||||
|
||||
/**
|
||||
* 序列化的数据输出流
|
||||
@@ -112,7 +111,7 @@ public abstract class Writer {
|
||||
if (!((Boolean) value)) return;
|
||||
}
|
||||
}
|
||||
this.writeFieldName(member.attribute);
|
||||
this.writeFieldName(member);
|
||||
member.encoder.convertTo(this, value);
|
||||
this.comma = true;
|
||||
}
|
||||
@@ -165,9 +164,9 @@ public abstract class Writer {
|
||||
/**
|
||||
* 输出一个字段名
|
||||
*
|
||||
* @param attribute 字段的Attribute对象
|
||||
* @param member 字段的EnMember对象
|
||||
*/
|
||||
public abstract void writeFieldName(Attribute attribute);
|
||||
public abstract void writeFieldName(EnMember member);
|
||||
|
||||
/**
|
||||
* 写入一个boolean值
|
||||
|
||||
@@ -180,7 +180,8 @@ public class BsonWriter extends Writer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeFieldName(Attribute attribute) {
|
||||
public final void writeFieldName(EnMember member) {
|
||||
Attribute attribute = member.getAttribute();
|
||||
writeByte(BsonReader.SIGN_HASNEXT);
|
||||
writeSmallString(attribute.field());
|
||||
byte typeval = 127; //字段的类型值
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package org.redkale.convert.json;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import org.redkale.convert.Writer;
|
||||
import org.redkale.convert.*;
|
||||
import org.redkale.util.*;
|
||||
|
||||
/**
|
||||
@@ -157,9 +157,9 @@ public class JsonWriter extends Writer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void writeFieldName(Attribute attribute) {
|
||||
public final void writeFieldName(EnMember member) {
|
||||
if (this.comma) writeTo(',');
|
||||
writeTo(true, attribute.field());
|
||||
writeTo(true, member.getAttribute().field());
|
||||
writeTo(':');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user