{"id":98,"date":"2023-02-18T06:34:03","date_gmt":"2023-02-17T22:34:03","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=98"},"modified":"2023-02-18T06:36:59","modified_gmt":"2023-02-17T22:36:59","slug":"fastjson-deserialize-string-null","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/18\/fastjson-deserialize-string-null\/","title":{"rendered":"fastjson\u53ef\u6b63\u5e38\u53cd\u5e8f\u5217\u5316\u5b57\u7b26\u4e32null"},"content":{"rendered":"<p>\u8e29\u5751\uff1aFastJson\u53ef\u6b63\u5e38\u53cd\u5e8f\u5217\u5316\u5b57\u7b26\u4e32null\uff0c\u8fd4\u56denull\uff0c\u800c\u4e0d\u4f1a\u629b\u51faJsonException\u5f02\u5e38<\/p>\n<pre><code class=\"language-java\">try {\n    User user = JSON.parseObject(&quot;null&quot;, User.class);\n    if (user == null) {\n        System.out.print(&quot;user = null&quot;);\n    }\n} catch (Exception e) {\n    e.printStackTrace();\n}<\/code><\/pre>\n<pre><code class=\"language-java\">public class User {\n    private String name;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8e29\u5751\uff1aFastJson\u53ef\u6b63\u5e38\u53cd\u5e8f\u5217\u5316\u5b57\u7b26\u4e32null\uff0c\u8fd4\u56denull\uff0c\u800c\u4e0d\u4f1a\u629b\u51faJsonException\u5f02\u5e38 t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[58],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-java-basic","tag-fastjson"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}