<br />
<b>Notice</b>:  Trying to get property 'ID' of non-object in <b>/var/www/html/feellikelearning/wp-content/themes/songwriter-premium/functions.php</b> on line <b>371</b><br />
{"version":"1.0","provider_name":"Feel Like Learning","provider_url":"https:\/\/feellikelearning.com","author_name":"feellikelearning","author_url":"https:\/\/feellikelearning.com\/index.php\/author\/feellikelearning\/","title":"Java \u53cd\u5c04\u5165\u95e8 | A short introduction to Java reflection | Feel Like Learning","type":"rich","width":600,"height":338,"html":"<blockquote class=\"wp-embedded-content\" data-secret=\"yoKMNoTk7e\"><a href=\"https:\/\/feellikelearning.com\/index.php\/2020\/04\/13\/cn-a-short-introduction-to-java-reflection\/\">Java \u53cd\u5c04\u5165\u95e8 | A short introduction to Java reflection<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/feellikelearning.com\/index.php\/2020\/04\/13\/cn-a-short-introduction-to-java-reflection\/embed\/#?secret=yoKMNoTk7e\" width=\"600\" height=\"338\" title=\"&#8220;Java \u53cd\u5c04\u5165\u95e8 | A short introduction to Java reflection&#8221; &#8212; Feel Like Learning\" data-secret=\"yoKMNoTk7e\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script type=\"text\/javascript\">\n\/*! This file is auto-generated *\/\n!function(c,d){\"use strict\";var e=!1,o=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},c.wp.receiveEmbedMessage);else if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(!t);else if(!(t.secret||t.message||t.value));else if(\/[^a-zA-Z0-9]\/.test(t.secret));else{for(var r,s,a,i=d.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),n=d.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),o=new RegExp(\"^https?:$\",\"i\"),l=0;l<n.length;l++)n[l].style.display=\"none\";for(l=0;l<i.length;l++)if(r=i[l],e.source!==r.contentWindow);else{if(r.removeAttribute(\"style\"),\"height\"===t.message){if(1e3<(s=parseInt(t.value,10)))s=1e3;else if(~~s<200)s=200;r.height=s}if(\"link\"===t.message)if(s=d.createElement(\"a\"),a=d.createElement(\"a\"),s.href=r.getAttribute(\"src\"),a.href=t.value,!o.test(a.protocol));else if(a.host===s.host)if(d.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener(\"message\",c.wp.receiveEmbedMessage,!1),d.addEventListener(\"DOMContentLoaded\",t,!1),c.addEventListener(\"load\",t,!1);function t(){if(o);else{o=!0;for(var e,t,r,s=-1!==navigator.appVersion.indexOf(\"MSIE 10\"),a=!!navigator.userAgent.match(\/Trident.*rv:11\\.\/),i=d.querySelectorAll(\"iframe.wp-embedded-content\"),n=0;n<i.length;n++){if(!(r=(t=i[n]).getAttribute(\"data-secret\")))r=Math.random().toString(36).substr(2,10),t.src+=\"#?secret=\"+r,t.setAttribute(\"data-secret\",r);if(s||a)(e=t.cloneNode(!0)).removeAttribute(\"security\"),t.parentNode.replaceChild(e,t);t.contentWindow.postMessage({message:\"ready\",secret:r},\"*\")}}}}(window,document);\n<\/script>\n","description":"\u53cd\u5c04\u5728Java\u662f\u4e2a\u6bd4\u8f83\u5947\u602a\u7684\u6982\u5ff5\uff0c\u80cc\u540e\u7684\u601d\u60f3\u5176\u5b9e\u5f88\u6df1\u523b\u3002\u4e00\u822c\u7a0b\u5e8f\u5305\u62ec\u7a0b\u5e8f(code)\u548c\u6570\u636e(data)\u4e24\u90e8\u5206\u3002\u5982\u679c\u4e00\u4e2a\u7a0b\u5e8f\u8ba1\u7b971+1\uff0c\u90a3\u4e481\u548c1\u662f\u6570\u636e\uff0c\u800c\u52a0\u6cd5\u8fd9\u4e2a\u64cd\u4f5c\u662fcode\uff0ccode\u662f\u7f16\u8bd1\u65f6\u5c31\u51b3\u5b9a\u7684\uff0c\u7f16\u8bd1\u540e\u5c31\u4e0d\u80fd\u518d\u66f4\u6539\uff0c\u6bd4\u5982\u8fd9\u91cc\u7684\u52a0\u6cd5\u3002\u800c\u53cd\u5c04\u8fd9\u4e2a\u6982\u5ff5\u5141\u8bb8\u4e86data\u4e5f\u53ef\u4ee5\u662fcode\u7684\u6982\u5ff5\u3002\u6bd4\u5982\u73b0\u5728\u7a0b\u5e8f\u53d8\u6210\u4e86f(1, 1)\uff0cf\u662f\u4e00\u4e2a\u672a\u77e5\u51fd\u6570\uff0c\u5b83\u4e5f\u662f&#8221;data&#8221;\uff0c\u53ef\u4ee5\u7531\u7528\u6237\u63d0\u4f9b\u3002\u7528\u6237\u63d0\u4f9b\u4e86\u4e58\u6cd5\uff0c\u90a3\u5c31\u662f\u4e58\u6cd5\uff0c\u63d0\u4f9b\u4e86\u51cf\u6cd5\uff0c\u90a3\u5c31\u662f\u51cf\u6cd5\u3002\u8fd9\u6837\u63d0\u4f9b\u4e00\u4e2a\u8ba9\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u4fee\u6539\u81ea\u5df1\u7684\u673a\u5236\u3002\u8fd9\u6837\u80fd\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8868\u8fbe\u529b\uff0c\u4e00\u4e9bJava\u7684\u6846\u67b6\u6bd4\u5982Spring\u5c31\u5927\u91cf\u7528\u5230\u53cd\u5c04\u3002Spring\u91cc\u9762\u5f88\u591amagical\u7684\u73b0\u8c61\u5c31\u662f\u8fd9\u6837\u5b9e\u73b0\u7684\uff0c\u6bd4\u5982\u6211\u660e\u660e\u53ea\u5199\u4e86\u4e00\u4e2aclass\uff0c\u53e6\u4e00\u4e2a\u5730\u65b9\u6211\u5c31\u81ea\u52a8\u6709\u4e86\u4e00\u4e2a\u8fd9\u4e2aclass\u7684object\uff0c\u800c\u6211\u660e\u660e\u6ca1\u6709\u5728\u4efb\u4f55\u5730\u65b9\u521d\u59cb\u5316\u8fd9\u4e48\u4e00\u4e2a\u5bf9\u8c61\u3002IDE\u91cc\u9762\u81ea\u52a8\u63d0\u793a\u4e00\u4e2aclass\u91cc\u9762\u7684available methods\u5e94\u8be5\u4e5f\u662f\u7528\u5230\u4e86reflection\u3002\u5728\u5e94\u7528\u4e2d\u6709\u4e9b\u574f\u5904\u4e5f\u662f\u663e\u800c\u6613\u89c1\uff0c\u9700\u8981\u5c0f\u5fc3\u3002\u5728Java\u91cc\u9762reflection\u901f\u5ea6\u6162\u8fd8\u662f\u5176\u6b21\uff0cIDE\u5f88\u96be\u68c0\u6d4b\u5230\u4ee3\u7801\u88ab\u5f15\u7528\uff0c\u8fd8\u6709\u5f88\u591acompiler\u53ef\u4ee5\u68c0\u6d4b\u5230\u7684\u9519\u8bef\u88ab\u6f0f\u8fc7\u4e86\uff0c\u53ea\u80fd\u5728run time\u51fa\u95ee\u9898\u3002\u800c\u4e14\u5141\u8bb8\u5916\u90e8\u8f93\u5165\u4ee3\u7801\u4e5f\u5e26\u6765\u5b89\u5168\u95ee\u9898\u3002\u5f88\u591a\u7f51\u7edc\u653b\u51fb\u7684\u539f\u7406\u6bd4\u5982SQL injection\u5c31\u662f\u5229\u7528\u4e86data\u4e5f\u662fcode\u7684\u8fd9\u79cd\u7279\u6027\u3002\u5173\u4e8erefelection\u5f88\u591a\u7684\u7528\u6cd5\u4ee5\u540e\u6211\u4f1a\u518d\u5199\u3002 \u672c\u6587\u901a\u8fc7\u4e00\u4e2a\u7b80\u5355\u7684Java\u4f8b\u5b50\u6765\u6f14\u793a\u4e00\u4e0bJava\u7684reflection\u3002Just get a feeling. Animal.java Tiger.java Lion.java Zoo.java \u8fd0\u884c\u7ed3\u679c Zoo.java \u4e3a\u4e3b\u7a0b\u5e8f\u3002\u91cc\u9762\u7684animal\u662f\u4ec0\u4e48\u8981\u770b\u7528\u6237\u63d0\u4f9b\u7684data\u51b3\u5b9a\u800c\u4e0d\u662fcompile time\u51b3\u5b9a\u7684\u3002\u5728IDE\u91cc\u9762\uff0c\u90fd\u627e\u4e0d\u5230Lion.java\u548cTiger.java\u7684\u5f15\u7528\u3002\u56e0\u4e3a\u4ed6\u4eec\u662f\u8fd9\u6837\u88ab\u7528\u5230\u7684\uff1aClass cls = Class.forName(className)\u3002className\u8fd8\u662f\u4e2aruntime\u624d\u80fd\u77e5\u9053\u7684String\uff0c\u8fde\u4eba\u7c7b\u90fd\u4e0d\u662f\u5f88\u5bb9\u6613\u80fd\u53d1\u73b0\uff0cIDE\u80fd\u77e5\u9053\u5c31\u771f\u7684\u5b9e\u73b0\u4eba\u5de5\u667a\u80fd\u4e86\u3002 \u867d\u7136\u6211\u672c\u4eba\u5e76\u4e0d\u662fReflection\u7684\u7c89\u4e1d\uff0c\u4f46\u662f\u56e0\u4e3a\u5408\u4f5c\u4e2d\u540c\u4e8b\u53ef\u80fd\u4f1a\u7528\u5230\uff0c\u6216\u8005\u516c\u53f8\u6240\u9009\u7684\u6846\u67b6\u7528\u5230\uff0c\u6bd4\u5982Spring\u4e4b\u7c7b\u4e5f\u662f\u88ab\u5e7f\u6cdb\u4f7f\u7528\uff0c\u8fd8\u662f\u5e94\u8be5\u62b1\u6709\u5f00\u653e\u7684\u5fc3\u6001\u5b66\u4e60\u5e76\u9a7e\u9a6d\u5b83\u3002 \u53e6\u5916\uff0c\u672c\u6587\u63d0\u4f9b\u7684\u5c0f\u7a0b\u5e8f\u7a0b\u5e8f\u4e5f\u5305\u542b\u4e86Java\u4ece\u952e\u76d8\u8f93\u5165data\u7684\u4f8b\u5b50\u3002"}