fastjson
fastjson copied to clipboard
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
1.自定义一个类继承hashmap,并在构造函数里设置一个值 2.序列化的时候用:SerializerFeature.WriteClassName 3.发送给服务端,服务端最终会执行DefaultJSONParser里365行代码,无法反序列化出正确的对象 测试代码如下: ```java public static class MyMap extends HashMap { private static final long serialVersionUID = -3933206767511509280L; public MyMap() { this.put("uuid", 1); } } @Test public void test1()...
String str = " { "_id" : "5aeab29ad45ca900017cd1b5"}"; 怎么直接调用 JSON.parseObject(String txt) 得到ObjectId对像?
``` import com.alibaba.fastjson.JSONObject class User{ var name: String? = null private set } fun main(args: Array) { val user = JSONObject.parseObject("{\"name\":\"fastjson\"}", User::class.java) println(user.name) } ``` 运行结果:```null``` 期望结果:```fastjson``` @wenshao 拜托支持一下~
### Problem description FASTJSON2 has problem to parse JSON to specific object by `JSON.parseObject()` mehod when polymorphism is used. Object type class inherits from some abstract class. To describe classes...
fix #3623
fix #3752 . If a field is a collection interface and do not have default implementation class set in fastjson, and if the filed have a instance when constructing, then...
添加了对key中存在冒号':'、逗号','时的支持。 fix #3613
fix #3720
- [x] Bug fix - [x] New test case - Fix the issue [#3720](https://github.com/alibaba/fastjson/issues/3720) - Add test case for this issue in `src/test/java/com/alibaba/fastjson/serializer/issue3720/TestLongWriter.java` - Change the test case `test_7_s()` and...
…长的代码分支抽取成独立方法做可读性优化。