Java的JSON处理器 fastjson

fmms 12年前
     <p>fastjson 是一个性能很好的 Java 语言实现的 JSON 解析器和生成器,来自阿里巴巴的工程师开发。</p>    <p>主要特点:</p>    <ul>     <li>快速FAST (比其它任何基于Java的解析器和生成器更快,包括jackson) </li>     <li>强大(支持普通JDK类包括任意Java Bean Class、Collection、Map、Date或enum) </li>     <li>零依赖(没有依赖其它任何类库除了JDK) </li>    </ul>    <p>示例代码:</p>    <pre class="brush:java; toolbar: true; auto-links: false;">import com.alibaba.fastjson.JSON;    Group group = new Group();  group.setId(0L);  group.setName("admin");    User guestUser = new User();  guestUser.setId(2L);  guestUser.setName("guest");    User rootUser = new User();  rootUser.setId(3L);  rootUser.setName("root");    group.getUsers().add(guestUser);  group.getUsers().add(rootUser);    String jsonString = JSON.toJSONString(group);    System.out.println(jsonString);</pre>    <p style="background-image:none;padding-bottom:0px;line-height:13pt;margin-top:10px;padding-left:0px;padding-right:0px;margin-bottom:10px;color:#333333;font-size:10pt;padding-top:0px;background-origin:initial;background-clip:initial;">这个版本没有New Features,只有bug fixed和improvement。这次的版本主要是对大对象的序列化(70M大小,包含大量小对象和循环引用)的性能优化,并且解决了一些用户反馈的bug。</p>    <p style="background-image:none;padding-bottom:0px;line-height:13pt;margin-top:10px;padding-left:0px;padding-right:0px;margin-bottom:10px;color:#333333;font-size:10pt;padding-top:0px;background-origin:initial;background-clip:initial;">fastjson使用越来越广泛,更多的反馈和更多的使用场景加速了趋于稳定的过程。谢谢大家的支持,我也尽量快速反应,解决大家使用中遇到的问题。</p>    <p style="background-image:none;padding-bottom:0px;line-height:13pt;margin-top:10px;padding-left:0px;padding-right:0px;margin-bottom:10px;color:#333333;font-size:10pt;padding-top:0px;background-origin:initial;background-clip:initial;">Bug<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-93]</span> - 序列化时大对象循环引用检测有性能问题<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-95]</span> - ASM优化关闭时,反序列化LinkedHashSet字段出错<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-96]</span> - ASM模式关闭时,Properties字段反序列化出错<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-97]</span> - parser处理List元素循环引用有BUG</p>    <p style="background-image:none;padding-bottom:0px;line-height:13pt;margin-top:10px;padding-left:0px;padding-right:0px;margin-bottom:10px;color:#333333;font-size:10pt;padding-top:0px;background-origin:initial;background-clip:initial;">Improvement<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-94]</span> - 优化WriteClassName<br /> <span style="background-color:#ffcccc;" class="error">[http://code.alibabatech.com/jira/browse/FASTJSON-98]</span> - 提供功能关闭循环引用检测</p>    <p style="background-image:none;padding-bottom:0px;line-height:13pt;margin-top:10px;padding-left:0px;padding-right:0px;margin-bottom:10px;color:#333333;font-size:10pt;padding-top:0px;background-origin:initial;background-clip:initial;">官方发行说明:<br /> <a href="/misc/goto?guid=4958191670780074164" target="_blank">http://code.alibabatech.com/wiki/display/FastJSON/Release+Notes+%281.1.6%29</a></p>