{"id":1115,"date":"2018-06-25T10:49:25","date_gmt":"2018-06-25T02:49:25","guid":{"rendered":"https:\/\/www.xiaobo.li\/?p=1115"},"modified":"2018-06-25T10:49:25","modified_gmt":"2018-06-25T02:49:25","slug":"java%e5%b8%b8%e7%94%a8json%e5%ba%93%e6%80%a7%e8%83%bd%e5%af%b9%e6%af%94","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/1115","title":{"rendered":"Java\u5e38\u7528Json\u5e93\u6027\u80fd\u5bf9\u6bd4"},"content":{"rendered":"<div id=\"cnblogs_post_body\" class=\"blogpost-body\">\n<p>Java\u5bf9\u4e8e\u5904\u7406JSON\u6570\u636e\u7684\u5e8f\u5217\u5316\u4e0e\u53cd\u5e8f\u5217\u5316\u76ee\u524d\u5e38\u7528\u7684\u7c7b\u5e93\u6709Gson\u3001FastJSON\u3001Jackson\u3001jettison\u4ee5\u53cajson-lib\u3002\u5728\u8fd9\u91cc\u6211\u4eec\u5c06\u5bf9\u8fd9\u4e9b\u7c7b\u5e93\u5728json\u5e8f\u5217\u5316\u4e0e\u53cd\u5e8f\u5217\u5316\u65b9\u9762\u7684\u6027\u80fd\u8fdb\u884c\u6d4b\u8bd5\u5bf9\u6bd4\u3002<\/p>\n<p><em><strong>\u4e2a\u4f8b\u6d4b\u8bd5\uff0c\u4ec5\u4f9b\u53c2\u8003\u3002<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u6d4b\u8bd5\u73af\u5883\u5982\u4e0b\uff1a<\/strong><\/p>\n<p>\u7535\u8111\uff1acpu\u4e3aI3-4160\uff0cWin7 64\u4f4d\u7cfb\u7edf<\/p>\n<p>\u7f16\u8bd1\u73af\u5883\uff1ajdk1.8.0_65\uff0cMyeclipse2014<\/p>\n<p>\u5404\u7c7b\u5e93\u7248\u672c\uff1agson-2.6.2\u3001fastjson-1.2.8\u3001jackson -2.7.2\u3001jettison-1.3.7\uff082014\u5e74\u540e\u65e0\u66f4\u65b0\uff09\u3001json-lib-2.4(2012\u5e74\u540e\u505c\u6b62\u66f4\u65b0)<\/p>\n<p>&nbsp;<\/p>\n<p>\u5e8f\u5217\u5316\u7684\u7b80\u5355\u5bf9\u8c61\uff1a<\/p>\n<p align=\"left\"><strong>publicclass<\/strong> User {<\/p>\n<p align=\"left\">\u00a0\u00a0\u00a0 <strong>int<\/strong>id;<\/p>\n<p align=\"left\">\u00a0\u00a0\u00a0 String name;<\/p>\n<p align=\"left\">\u00a0\u00a0\u00a0 <strong>int<\/strong>age;<\/p>\n<p>\u00a0\u00a0\u00a0 String address;<\/p>\n<p align=\"left\">\u00a0\u00a0\u00a0 \/\/get\u3001set<\/p>\n<p align=\"left\">}<\/p>\n<p align=\"left\">\n<p align=\"left\"><strong>\u6d4b\u8bd5\u7ed3\u679c<\/strong><strong>\uff1a<\/strong><\/p>\n<p align=\"left\">\n<p align=\"left\">\u5e8f\u5217\u5316\u6d4b\u8bd5\u7ed3\u679c\uff08Object-&gt;String\uff09\uff0c\u8017\u65f6\u5355\u4f4d\u5747\u4e3ams<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\"><strong>\u6d4b\u8bd5\u6b21\u6570<\/strong><\/p>\n<p><strong>\u7c7b\u5e93<\/strong><\/td>\n<td width=\"71\">\n<p align=\"center\">100<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1K<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">10W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">50W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">100W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1000W<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"71\">\n<p align=\"center\">gson<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">8<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">25<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">63<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">230<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">680<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1100<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">7790<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"71\">\n<p align=\"center\">fastjson<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">85<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">100<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">155<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">200<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">270<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">350<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1850<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"71\">\n<p align=\"center\">jackson<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">35<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">48<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">80<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">150<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">255<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">360<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">2400<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"71\">\n<p align=\"center\">Json-lib<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">75<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">130<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">280<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">910<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">2725<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">4900<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">42500<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"71\">\n<p align=\"center\">jettison<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">70<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">85<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">110<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">210<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">400<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">590<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">4000<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p align=\"left\">\n<p align=\"left\">\n<p align=\"left\">\u53cd\u5e8f\u5217\u5316\u6d4b\u8bd5\u7ed3\u679c\uff08String-&gt;Object\uff09\uff0c\u8017\u65f6\u5355\u4f4d\u5747\u4e3ams<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\"><strong>\u6d4b\u8bd5\u6b21\u6570<\/strong><\/p>\n<p><strong>\u7c7b\u5e93<\/strong><\/td>\n<td width=\"71\">\n<p align=\"center\">100<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1K<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">10W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">50W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">100W<\/p>\n<\/td>\n<td width=\"71\">\n<p align=\"center\">1000W<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">gson<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">9<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">21<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">60<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">195<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">570<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">950<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">7760<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">fastjson<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">85<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">105<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">150<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">225<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">370<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">545<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">3800<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">jackson<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">36<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">50<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">110<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">210<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">380<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">570<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">4460<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">Json-lib<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">86<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">185<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">405<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">1180<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">2950<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">4850<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">38300<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">jettison<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">6<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">20<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">50<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">230<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">460<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">710<\/p>\n<\/td>\n<td valign=\"top\" width=\"71\">\n<p align=\"center\">4650<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p align=\"left\">\n<p align=\"left\">\n<p align=\"left\"><strong>\u6d4b\u8bd5\u603b\u7ed3\uff1a<\/strong><\/p>\n<p align=\"left\">1\u3001\u4ece\u6d4b\u8bd5\u7ed3\u679c\u53ef\u4ee5\u770b\u51fagson\u5728\u5c0f\u4e8e10w\u7684\u6570\u636e\u91cf\u5904\u7406\u4e0a\uff0c\u8017\u65f6\u76f8\u5bf9\u8f83\u5c11\uff0c\u4f46\u662f\u5728\u6570\u636e\u8d8a\u6765\u8d8a\u5927\u7684\u60c5\u51b5\u4e0b\u8017\u65f6\u4f1a\u660e\u663e\u7684\u589e\u957f\u3002<\/p>\n<p align=\"left\">2<strong>\u3001<\/strong>\u65e0\u8bba\u90a3\u79cd\u60c5\u51b5\u4e0b\uff0cjson-lib\u7684\u8017\u65f6\u90fd\u662f\u6700\u591a\u7684\uff0c\u5f15\u7528\u65f6\u8fd8\u9700\u8981\u989d\u5916\u51e0\u4e2a\u4f9d\u8d56\u5305\uff0c\u4e14\u76ee\u524d\u5df2\u7ecf\u505c\u6b62\u4e86\u66f4\u65b0\uff0c\u6240\u4ee5\u4e0d\u63a8\u8350\u4f7f\u7528\u3002<\/p>\n<p align=\"left\">3\u3001jackson\u5728\u5404\u9636\u6bb5\u6570\u636e\u91cf\u90fd\u6709\u5f88\u4e0d\u9519\u7684\u6027\u80fd\uff0c\u800cfastjson\u5728\u6570\u636e\u91cf\u8f83\u591a\u7684\u60c5\u51b5\u4e0b\u4e5f\u6709\u5f88\u597d\u6027\u80fd\u3002<\/p>\n<p align=\"left\">4\u3001jettison\u6027\u80fd\u4e0d\u9519\uff0c\u4f46\u53ea\u63d0\u4f9bjson\u548c\u5176JSONObject\u5bf9\u8c61\u76f8\u4e92\u8f6c\u5316\u7684\u65b9\u6cd5\uff0c\u8f6c\u4e3a\u81ea\u5b9a\u4e49bean\u65f6\u9700\u8981\u518d\u624b\u52a8\u5c06JSONObject\u5bf9\u8c61\u8f6c\u4e3a\u9700\u8981\u7684bean\u3002<\/p>\n<\/div>\n<div class=\"clear\"><\/div>\n<div id=\"blog_post_info_block\">\n<div id=\"BlogPostCategory\">\u6587\u7ae0\u6765\u6e90\uff1a https:\/\/www.cnblogs.com\/aurain\/p\/6734873.html<\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Java\u5bf9\u4e8e\u5904\u7406JSON\u6570\u636e\u7684\u5e8f\u5217\u5316\u4e0e\u53cd\u5e8f\u5217\u5316\u76ee\u524d\u5e38\u7528\u7684\u7c7b\u5e93\u6709Gson\u3001Fast &hellip; <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/1115\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[297],"tags":[88],"class_list":["post-1115","post","type-post","status-publish","format-standard","hentry","category-java","tag-json"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=1115"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/1115\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}