We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayNode arrayNode=new ArrayNode(new JsonNodeFactory(true)); arrayNode.add(32342342342l); 我们的数据类型是ArrayNode,序列化上面的arrayNode的结果是: {"@type":"com.fasterxml.jackson.databind.node.ArrayNode","array":true,"bigDecimal":false,"bigInteger":false,"binary":false,"boolean":false,"containerNode":true,"double":false,"empty":false,"float":false,"floatingPointNumber":false,"int":false,"integralNumber":false,"long":false,"missingNode":false,"nodeType":"ARRAY","null":false,"number":false,"object":false,"pojo":false,"short":false,"textual":false,"valueNode":false}
ArrayNode arrayNode=new ArrayNode(new JsonNodeFactory(true)); arrayNode.add(32342342342l);
32342342342l这个值丢失了
The text was updated successfully, but these errors were encountered:
https://github.com/alibaba/fastjson2/issues 可以提issue到这里么?
Sorry, something went wrong.
debug版本:1.2.83 JSON.toJSONString(Object object)进行对象序列化会调用object对应的ObjectSerializer接口实现类的write(),而com.fasterxml.jackson.databind.node.ArrayNode对应的ObjectSerializer实现类是com.alibaba.fastjson.serializer.JavaBeanSerializer,获取的位置com.alibaba.fastjson.serializer.JSONSerializer#getObjectWriter
深入到getObjectWriter(),经过一系列的判断,选择创建JavaBeanSerializer,位置:/com/alibaba/fastjson/serializer/SerializeConfig.java:821,可以看到是基于BeanInfo数据进行创建的,BeanInfo包含了要序列化的数据 而在TypeUtils.buildBeanInfo中重点就是这个,根据is和get开头的函数来确定Field,ArrayNode.add()是将对象放到_children,该Field并没有get方法 在JavaBeanSerializer.write()就是根据BeanInfo的数据来序列化信息了
No branches or pull requests
ArrayNode arrayNode=new ArrayNode(new JsonNodeFactory(true)); arrayNode.add(32342342342l);
我们的数据类型是ArrayNode,序列化上面的arrayNode的结果是:
{"@type":"com.fasterxml.jackson.databind.node.ArrayNode","array":true,"bigDecimal":false,"bigInteger":false,"binary":false,"boolean":false,"containerNode":true,"double":false,"empty":false,"float":false,"floatingPointNumber":false,"int":false,"integralNumber":false,"long":false,"missingNode":false,"nodeType":"ARRAY","null":false,"number":false,"object":false,"pojo":false,"short":false,"textual":false,"valueNode":false}
32342342342l这个值丢失了
The text was updated successfully, but these errors were encountered: