{"id":375,"date":"2023-05-28T01:37:16","date_gmt":"2023-05-27T17:37:16","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=375"},"modified":"2023-05-28T01:37:17","modified_gmt":"2023-05-27T17:37:17","slug":"%e5%8f%8d%e5%b0%84%e4%b8%8e%e8%87%aa%e5%ae%9a%e4%b9%89%e6%b3%a8%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/%e5%8f%8d%e5%b0%84%e4%b8%8e%e8%87%aa%e5%ae%9a%e4%b9%89%e6%b3%a8%e8%a7%a3\/","title":{"rendered":"\u53cd\u5c04\u4e0e\u81ea\u5b9a\u4e49\u6ce8\u89e3"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"font-size: 15px; letter-spacing: 1px; line-height: 2; padding: 0px 5px; box-sizing: border-box; font-style: normal; font-weight: 400; text-align: justify;\">\n<section style=\"text-align: center; margin-top: 10px; margin-bottom: 10px; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; box-sizing: border-box;\">\n<section style=\"width: 8px; height: 8px; display: inline-block; vertical-align: middle; border-radius: 100%; box-sizing: border-box; border: 2px solid #7fa1bf;\"><\/section>\n<section style=\"width: 3em; border-top: 2px solid #7fa1bf; display: inline-block; vertical-align: middle; box-sizing: border-box;\"><\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; padding-left: 5px; padding-right: 5px; font-size: 23px; min-width: 1.2em !important; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">1<\/p>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; box-sizing: border-box;\">\n<section style=\"width: 3em; border-top: 2px solid #7fa1bf; display: inline-block; vertical-align: middle; box-sizing: border-box;\"><\/section>\n<section style=\"width: 8px; height: 8px; display: inline-block; vertical-align: middle; border-radius: 100%; box-sizing: border-box; border: 2px solid #7fa1bf;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"margin-top: 10px; margin-bottom: 10px; text-align: center; box-sizing: border-box;\">\n<section style=\"padding: 3px; display: inline-block; border-bottom: 1px solid #5f9cef; text-align: justify; font-size: 20px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u673a\u5236<\/p>\n<\/section>\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u5b9a\u4e49<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u901a\u8fc7\u53cd\u5c04\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u83b7\u5f97\u7a0b\u5e8f\u6216\u7a0b\u5e8f\u96c6\u4e2d\u6bcf\u4e00\u4e2a\u7c7b\u578b\u7684\u6210\u5458\u548c\u6210\u5458\u7684\u4fe1\u606f\u3002\u7a0b\u5e8f\u4e2d\u4e00\u822c\u7684\u5bf9\u8c61\u7684\u7c7b\u578b\u90fd\u662f\u5728\u7f16\u8bd1\u671f\u5c31\u786e\u5b9a\u4e0b\u6765\u7684\uff0c\u800c Java \u53cd\u5c04\u673a\u5236\u53ef\u4ee5\u52a8\u6001\u5730\u521b\u5efa\u5bf9\u8c61\u5e76\u8c03\u7528\u5176\u5c5e\u6027\uff0c\u8fd9\u6837\u7684\u5bf9\u8c61\u7684\u7c7b\u578b\u5728\u7f16\u8bd1\u671f\u662f\u672a\u77e5\u7684\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u53cd\u5c04\u673a\u5236\u76f4\u63a5\u521b\u5efa\u5bf9\u8c61\uff0c\u5373\u4f7f\u8fd9\u4e2a\u5bf9\u8c61\u7684\u7c7b\u578b\u5728\u7f16\u8bd1\u671f\u662f\u672a\u77e5\u7684\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Java\u53cd\u5c04\u673a\u5236\u7684\u6838\u5fc3\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u52a8\u6001\u52a0\u8f7d\u7c7b\u5e76\u83b7\u53d6\u7c7b\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u4ece\u800c\u64cd\u4f5c\u7c7b\u6216\u5bf9\u8c61\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u672c\u8d28\u662fJVM\u5f97\u5230class\u5bf9\u8c61\u4e4b\u540e\uff0c\u518d\u901a\u8fc7class\u5bf9\u8c61\u8fdb\u884c\u53cd\u7f16\u8bd1\uff0c\u4ece\u800c\u83b7\u53d6\u5bf9\u8c61\u7684\u5404\u79cd\u4fe1\u606f\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Java\u5c5e\u4e8e\u5148\u7f16\u8bd1\u518d\u8fd0\u884c\u7684\u8bed\u8a00\uff0c\u7a0b\u5e8f\u4e2d\u5bf9\u8c61\u7684\u7c7b\u578b\u5728\u7f16\u8bd1\u671f\u5c31\u786e\u5b9a\u4e0b\u6765\u4e86\uff0c\u800c\u5f53\u7a0b\u5e8f\u5728\u8fd0\u884c\u65f6\u53ef\u80fd\u9700\u8981\u52a8\u6001\u52a0\u8f7d\u67d0\u4e9b\u7c7b\uff0c\u8fd9\u4e9b\u7c7b\u56e0\u4e3a\u4e4b\u524d\u7528\u4e0d\u5230\uff0c\u6240\u4ee5\u6ca1\u6709\u88ab\u52a0\u8f7d\u5230JVM\u3002\u901a\u8fc7\u53cd\u5c04\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u5730\u521b\u5efa\u5bf9\u8c61\u5e76\u8c03\u7528\u5176\u5c5e\u6027\uff0c\u4e0d\u9700\u8981\u63d0\u524d\u5728\u7f16\u8bd1\u671f\u77e5\u9053\u8fd0\u884c\u7684\u5bf9\u8c61\u662f\u4ec0\u4e48\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u673a\u5236\u7684\u4f18\u7f3a\u70b9<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"font-size: 18px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u4f18\u70b9\uff1a<\/strong><\/span><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5728\u8fd0\u884c\u65f6\u83b7\u5f97\u7c7b\u7684\u5404\u79cd\u5185\u5bb9\uff0c\u8fdb\u884c\u53cd\u7f16\u8bd1\uff0c\u5bf9\u4e8eJava\u8fd9\u79cd\u5148\u7f16\u8bd1\u518d\u8fd0\u884c\u7684\u8bed\u8a00\uff0c\u80fd\u591f\u8ba9\u6211\u4eec\u5f88\u65b9\u4fbf\u7684\u521b\u5efa\u7075\u6d3b\u7684\u4ee3\u7801\uff0c\u8fd9\u4e9b\u4ee3\u7801\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u88c5\u914d\uff0c\u65e0\u9700\u5728\u7ec4\u4ef6\u4e4b\u95f4\u8fdb\u884c\u6e90\u4ee3\u7801\u7684\u94fe\u63a5\uff0c\u66f4\u52a0\u5bb9\u6613\u5b9e\u73b0\u9762\u5411\u5bf9\u8c61\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u7b80\u5355\u8bf4\uff1a\u5176<strong style=\"box-sizing: border-box;\">\u76ee\u7684\uff0c\u63d0\u4f9b\u5f00\u53d1\u8005\u80fd\u591f\u66f4\u597d\u5c01\u88c5\u6846\u67b6\u5b9e\u73b0\u6269\u5c55\u529f\u80fd<\/strong>\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"font-size: 18px; box-sizing: border-box;\">\u7f3a\u70b9\uff1a<\/span><\/strong><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">1\u3001\u53cd\u5c04\u4f1a\u6d88\u8017\u4e00\u5b9a\u7684\u7cfb\u7edf\u8d44\u6e90\uff0c\u56e0\u6b64\u5982\u679c\u4e0d\u9700\u8981\u52a8\u6001\u5730\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\uff0c\u90a3\u4e48\u5c31\u4e0d\u9700\u8981\u7528\u53cd\u5c04\uff1b<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">2\u3001\u53cd\u5c04\u8c03\u7528\u65b9\u6cd5\u65f6\u53ef\u4ee5\u5ffd\u7565\u6743\u9650\u68c0\u67e5\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u7834\u574f\u5c01\u88c5\u6027\u800c\u5bfc\u81f4\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u7684\u7528\u9014<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u7f16\u8bd1\uff1a.class --&gt; .java<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">1\u3001\u901a\u8fc7\u53cd\u5c04\u673a\u5236\u8bbf\u95eejava\u5bf9\u8c61\u7684\u5c5e\u6027\uff0c\u65b9\u6cd5\uff0c\u6784\u9020\u65b9\u6cd5\u7b49<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">2\u3001JDBC\u52a0\u8f7d\u9a71\u52a8\u8fde\u63a5\u00a0 class.forName()<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u00a0\u00a0\u00a0\u00a0Class.forName(\"com.mysql.jdbc.Driver\");\/\/ \u52a8\u6001\u52a0\u8f7dmysql\u9a71\u52a8<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">3\u3001Spring\u5bb9\u5668\u6846\u67b6IOC\u5b9e\u4f8b\u5316\u5bf9\u8c61<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">&lt;bean id=\"XxEntity\" class=\"package.XxEntity\" \/&gt;<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">4\u3001\u81ea\u5b9a\u4e49\u6ce8\u89e3\u751f\u6548\uff08\u53cd\u5c04+AOP\uff09<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">5\u3001\u7b2c\u4e09\u65b9\u6838\u5fc3\u7684\u6846\u67b6 mybatis orm<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u6280\u672f\u7684\u4f7f\u7528<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"min-height: 40px; margin: 10px 0%; box-sizing: border-box;\">\n<section style=\"width: 100%; margin: 0px auto -10px; box-sizing: border-box;\">\n<table style=\"border-collapse: collapse; box-sizing: border-box; margin-bottom: 10px;\" width=\"100%\">\n<tbody style=\"box-sizing: border-box;\">\n<tr style=\"box-sizing: border-box;\">\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"28.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: center; white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Class\u7c7b<\/p>\n<\/section>\n<\/section>\n<\/td>\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"72.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"text-align: center; padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4ee3\u8868\u7c7b\u7684\u5b9e\u4f53\uff0c\u5728\u8fd0\u884c\u7684Java\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8868\u793a\u7c7b\u548c\u63a5\u53e3<\/p>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<tr style=\"box-sizing: border-box;\">\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"28.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: center; white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Field\u7c7b<\/p>\n<\/section>\n<\/section>\n<\/td>\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"72.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"text-align: center; padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4ee3\u8868\u7c7b\u7684\u6210\u5458\u53d8\u91cf\uff08\u6210\u5458\u53d8\u91cf\u4e5f\u79f0\u4e3a\u7c7b\u7684\u5c5e\u6027\uff09<\/p>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<tr style=\"box-sizing: border-box;\">\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"28.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: center; white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Method\u7c7b<\/p>\n<\/section>\n<\/section>\n<\/td>\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"72.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"text-align: center; padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4ee3\u8868\u7c7b\u7684\u65b9\u6cd5<\/p>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<tr style=\"box-sizing: border-box;\">\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"28.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: center; white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Constructor\u7c7b<\/p>\n<\/section>\n<\/section>\n<\/td>\n<td style=\"box-sizing: border-box; padding: 0px; border: 1px solid #3e3e3e;\" colspan=\"1\" rowspan=\"1\" width=\"72.0000%\">\n<section style=\"margin: 5px 0%; box-sizing: border-box;\">\n<section style=\"text-align: center; padding: 0px 5px; box-sizing: border-box;\">\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4ee3\u8868\u7c7b\u7684\u6784\u9020\u65b9\u6cd5<\/p>\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">1.getField\u3001getMethod\u548cgetCostructor\u65b9\u6cd5\u53ef\u4ee5\u83b7\u5f97\u6307\u5b9a\u540d\u5b57\u7684\u57df\u3001\u65b9\u6cd5\u548c\u6784\u9020\u5668\u3002<\/p>\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">2.getFields\u3001getMethods\u548cgetCostructors\u65b9\u6cd5\u53ef\u4ee5\u83b7\u5f97\u7c7b\u63d0\u4f9b\u7684public\u57df\u3001\u65b9\u6cd5\u548c\u6784\u9020\u5668\u6570\u7ec4\uff0c\u5176\u4e2d\u5305\u62ec\u8d85\u7c7b\u7684\u5171\u6709\u6210\u5458\u3002<\/p>\n<p style=\"text-align: left; margin: 0px; padding: 0px; box-sizing: border-box;\">3.getDeclatedFields\u3001getDeclatedMethods\u548cgetDeclaredConstructors\u65b9\u6cd5\u53ef\u4ee5\u83b7\u5f97\u7c7b\u4e2d\u58f0\u660e\u7684\u5168\u90e8\u57df\u3001\u65b9\u6cd5\u548c\u6784\u9020\u5668\uff0c\u5176\u4e2d\u5305\u62ec\u79c1\u6709\u548c\u53d7\u4fdd\u62a4\u7684\u6210\u5458\uff0c\u4f46\u4e0d\u5305\u62ec\u8d85\u7c7b\u7684\u6210\u5458\u3002<\/p>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u5e38\u7528\u7684api<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">1\u3001Object--&gt;getClass<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">2\u3001\u4efb\u4f55\u6570\u636e\u7c7b\u578b\uff08\u5305\u62ec\u57fa\u672c\u7684\u6570\u636e\u7c7b\u578b\uff09\u90fd\u6709\u4e00\u4e2a\u201c\u9759\u6001\u201d\u7684class\u5c5e\u6027<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">3\u3001\u901a\u8fc7class\u7c7b\u7684\u9759\u6001\u65b9\u6cd5\uff1aforName(String className)<strong style=\"box-sizing: border-box;\">\uff08\u6700\u5e38\u7528\uff09<\/strong><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">Class aClass = Class.forName(\"package.XxEntity\");<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">Class01<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest01<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 1.\u7b2c\u4e00\u79cd\u83b7\u53d6class\u65b9\u5f0f\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class01 class01 = <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">new<\/span> Class01();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class test01 = class01.getClass();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u9ed8\u8ba4\u6267\u884c\u65e0\u53c2\u6784\u9020\u51fd\u6570\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class01 class02 = (Class01) test01.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(class01 == class02); <span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ false<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 2.\u7b2c\u4e8c\u79cd\u65b9\u5f0f \u76f4\u63a5\u83b7\u53d6class\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;Class01&gt; aClass01 = Class01.class;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class01 class03 = aClass01.newInstance();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(class03);<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ Class01(name=null)<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 3.\u7b2c\u4e09\u79cd\u65b9\u5f0f \u7c7b\u7684\u5b8c\u6574\u8def\u5f84\u5730\u5740\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass02 = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.Class01\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class01 class04 = (Class01) aClass02.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(class04);<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ Class01(name=null)\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u8fd0\u884c\u671f\u95f4\uff0c\u4e00\u4e2a\u7c7b\uff0c\u53ea\u6709\u4e00\u4e2aClass\u5bf9\u8c61\u4ea7\u751f<\/strong><\/span><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4ee3\u7801\u9a8c\u8bc1<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ new\u5bf9\u8c61<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class01 class01 = <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">new<\/span> Class01();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;? extends Class01&gt; aClass01 = class01.getClass();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u76f4\u63a5.class<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;Class01&gt; aClass02 = Class01.class;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u7c7b\u7684\u5b8c\u6574\u8def\u5f84<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;?&gt; aClass03 = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.Class01\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(aClass01 == aClass02);\n<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ true<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(aClass01 == aClass03);<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ true<\/span><\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u6784\u9020\u51fd\u6570<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6267\u884c\u65e0\u53c2\u6784\u9020\u51fd\u6570<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.Class01\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u9ed8\u8ba4\u6267\u884c\u65e0\u53c2\u6784\u9020\u51fd\u6570\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class01 class01 = (Class01) aClass.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(class01);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u6267\u884c\u6709\u53c2\u6784\u9020\u51fd\u6570<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.calss.entity.Class01\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Constructor&lt;?&gt; constructor = aClass.getConstructor(String.class);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class01 class02 = (Class01) constructor.newInstance(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"test\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(class02);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u7ed9\u5c5e\u6027\u8d4b\u503c<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u7ed9\u516c\u6709\u5c5e\u6027\u8d4b\u503c<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">UserEntity<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String remark;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest04<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u53cd\u5c04\u83b7\u53d6class\u6587\u4ef6\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.UserEntity\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u65e0\u53c2\u6784\u9020\u51fd\u6570\u521b\u5efa\u5bf9\u8c61\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0UserEntity userEntity = (UserEntity) aClass.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ class\u6587\u4ef6\u83b7\u53d6\u516c\u6709\u5c5e\u6027\uff0c\u5e76\u8bbe\u7f6e\u503c\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Field remark = aClass.getField(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"remark\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0remark.set(userEntity, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\u5907\u6ce8\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(userEntity);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u7ed9\u79c1\u6709\u5c5e\u6027\u8d4b\u503c<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">UserEntity<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String remark;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest04<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u53cd\u5c04\u83b7\u53d6class\u6587\u4ef6\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.UserEntity\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u65e0\u53c2\u6784\u9020\u51fd\u6570\u521b\u5efa\u5bf9\u8c61\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0UserEntity userEntity = (UserEntity) aClass.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ class\u6587\u4ef6\u83b7\u53d6\u516c\u6709\u5c5e\u6027\uff0c\u5e76\u8bbe\u7f6e\u503c\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Field remark = aClass.getField(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"remark\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0remark.set(userEntity, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\u5907\u6ce8\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ class\u6587\u4ef6\u83b7\u53d6\u79c1\u6709\u5c5e\u6027\uff0c\u5e76\u8bbe\u7f6e\u503c\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Field name = aClass.getDeclaredField(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"name\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0name.setAccessible(<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">true<\/span>);\n<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u8bbe\u7f6e\u5141\u8bb8\u8bbf\u95ee\u79c1\u6709\u5c5e\u6027\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0name.set(userEntity, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"userName\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(userEntity);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u610f\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"color: #f96e57; box-sizing: border-box;\">Exception in thread \"main\"\u00a0<\/span><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"color: #f96e57; box-sizing: border-box;\">\u00a0\u00a0\u00a0\u00a0java.lang.IllegalAccessException:\u00a0<\/span><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"color: #f96e57; box-sizing: border-box;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0UserEntity with modifiers \"private\"<\/span><\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><span style=\"font-size: 16px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u89e3\u51b3\u65b9\u6848<\/strong><\/span>\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\/\/ \u8bbe\u7f6e\u5141\u8bb8\u8bbf\u95ee\u79c1\u6709\u5c5e\u6027<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">field.setAccessible(true);<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u8c03\u7528\u65b9\u6cd5<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u8c03\u7528\u516c\u6709\u65b9\u6cd5<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">UserEntity<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String remark;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">publicTest<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"public test....\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">privateTest<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"private test...\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest05<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.UserEntity\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0UserEntity userEntity = (UserEntity) aClass.newInstance();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Method publicTest = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"publicTest\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0publicTest.invoke(userEntity);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u53cd\u5c04\u6267\u884c\u8c03\u7528\u79c1\u6709\u65b9\u6cd5<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">UserEntity<\/span> <\/span>{<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0\n<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String remark;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">publicTest<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"public test....\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">privateTest<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"private test...\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest05<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.UserEntity\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0UserEntity userEntity = (UserEntity) aClass.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u516c\u6709<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Method publicTest = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"publicTest\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0publicTest.invoke(userEntity);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u79c1\u6709<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Method privateTest = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"privateTest\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0privateTest.setAccessible(<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">true<\/span>);<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u8bbe\u7f6e\u5141\u8bb8\u8c03\u7528\u79c1\u6709\u65b9\u6cd5<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0privateTest.invoke(userEntity);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"font-size: 16px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u53cd\u5c04\u8c03\u7528\u65b9\u6cd5\u4f20\u9012\u53c2\u6570<\/strong><\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Data<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">UserEntity<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> String name;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String remark;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">publicTest<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String i, Integer j)<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"String i:\"<\/span> + i + <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\",Integer j:\"<\/span> + j);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest06<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.class_s.entity.UserEntity\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0UserEntity userEntity = (UserEntity) aClass.newInstance();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u516c\u6709\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Method publicTest = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"publicTest\"<\/span>, String.class, Integer.class);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0publicTest.invoke(userEntity, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"iString\"<\/span>, <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u901a\u8fc7\u53cd\u5c04\u8d8a\u8fc7\u6cdb\u578b\u68c0\u67e5<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">ClassTest07<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">static<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">void<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">main<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(String[] args)<\/span> <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">throws<\/span> Exception <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0ArrayList&lt;String&gt; strings = <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">new<\/span> ArrayList&lt;&gt;();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0strings.add(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"1\"<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(strings.size());<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 1<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Class&lt;? extends ArrayList&gt; aClass = strings.getClass();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0Method add = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"add\"<\/span>, Object.class);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0add.invoke(strings, <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0System.out.println(strings.size());\n<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 2<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6cdb\u578b\u7528\u5728\u7f16\u8bd1\u671f\uff0c\u7f16\u8bd1\u8fc7\u540e\u6cdb\u578b\u64e6\u9664\uff08\u6d88\u5931\u6389\uff09\uff0c\u6240\u4ee5\u662f\u53ef\u4ee5\u901a\u8fc7\u53cd\u5c04\u8d8a\u8fc7\u6cdb\u578b\u68c0\u67e5\u7684\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"text-align: center; margin-top: 10px; margin-bottom: 10px; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; box-sizing: border-box;\">\n<section style=\"width: 8px; height: 8px; display: inline-block; vertical-align: middle; border-radius: 100%; box-sizing: border-box; border: 2px solid #7fa1bf;\"><\/section>\n<section style=\"width: 3em; border-top: 2px solid #7fa1bf; display: inline-block; vertical-align: middle; box-sizing: border-box;\"><\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; padding-left: 5px; padding-right: 5px; font-size: 23px; min-width: 1.2em !important; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">2<\/p>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; box-sizing: border-box;\">\n<section style=\"width: 3em; border-top: 2px solid #7fa1bf; display: inline-block; vertical-align: middle; box-sizing: border-box;\"><\/section>\n<section style=\"width: 8px; height: 8px; display: inline-block; vertical-align: middle; border-radius: 100%; box-sizing: border-box; border: 2px solid #7fa1bf;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"margin-top: 10px; margin-bottom: 10px; text-align: center; box-sizing: border-box;\">\n<section style=\"padding: 3px; display: inline-block; border-bottom: 1px solid #5f9cef; text-align: justify; font-size: 20px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u5b9a\u4e49<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u89e3\u7528\u6765\u7ed9\u7c7b\u58f0\u660e\u9644\u52a0\u989d\u5916\u4fe1\u606f\uff0c\u53ef\u4ee5\u6807\u6ce8\u5728\u7c7b\u3001\u5b57\u6bb5\u3001\u65b9\u6cd5\u7b49\u4e0a\u9762\uff0c\u7f16\u8bd1\u5668\u3001JVM\u4ee5\u53ca\u5f00\u53d1\u4eba\u5458\u7b49\u53ef\u4ee5\u901a\u8fc7\u53cd\u5c04\u62ff\u5230\u6ce8\u89e3\u4fe1\u606f\uff0c\u8fdb\u800c\u505a\u4e00\u4e9b\u76f8\u5173\u5904\u7406\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u4f8b\uff1aSpringBoot\u5168\u90e8\u90fd\u662f\u91c7\u7528\u6ce8\u89e3\u5316<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u5e38\u7528\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Override<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u53ea\u80fd\u6807\u6ce8\u5728\u5b50\u7c7b\u8986\u76d6\u7236\u7c7b\u7684\u65b9\u6cd5\u4e0a\u9762\uff0c\u6709\u63d0\u793a\u7684\u4f5c\u7528<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Deprecated<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6807\u6ce8\u5728\u8fc7\u65f6\u7684\u65b9\u6cd5\u6216\u7c7b\u4e0a\u9762\uff0c\u6709\u63d0\u793a\u7684\u4f5c\u7528<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@SuppressWarnings(\"unchecked\")<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6807\u6ce8\u5728\u7f16\u8bd1\u5668\u8ba4\u4e3a\u6709\u95ee\u9898\u7684\u7c7b\u3001\u65b9\u6cd5\u7b49\u4e0a\u9762\uff0c\u7528\u6765\u53d6\u6d88\u7f16\u8bd1\u5668\u7684\u8b66\u544a\u63d0\u793a\uff0c\u8b66\u544a\u7c7b\u578b\u6709serial\u3001unchecked\u3001unused\u3001all<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"margin-top: 10px; margin-bottom: 10px; text-align: center; box-sizing: border-box;\">\n<section style=\"padding: 3px; display: inline-block; border-bottom: 1px solid #5f9cef; text-align: justify; font-size: 20px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5143\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u5143\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5143\u6ce8\u89e3\u7528\u6765\u5728\u58f0\u660e\u65b0\u6ce8\u89e3\u65f6\u6307\u5b9a\u65b0\u6ce8\u89e3\u7684\u4e00\u4e9b\u7279\u6027<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Target<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u6807\u6ce8\u7684\u4f4d\u7f6e\uff0c\u6bd4\u5982\u7c7b\u3001\u5b57\u6bb5\u3001\u65b9\u6cd5\u7b49\uff0c\u53d6\u503c\u6709ElementType.Method\u7b49<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Retention<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u7684\u4fe1\u606f\u4fdd\u7559\u5230\u4ec0\u4e48\u65f6\u5019\uff0c\u53d6\u503c\u6709RetentionPolicy.RUNTIME\u7b49<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Inherited<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u6807\u6ce8\u5728\u7236\u7c7b\u4e0a\u65f6\u53ef\u88ab\u5b50\u7c7b\u7ee7\u627f<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u5e38\u7528\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Target(ElementType.METHOD) \/<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u53ef\u4ee5\u6807\u6ce8\u5728\u65b9\u6cd5\u4e0a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Retention(RetentionPolicy.RUNTIME)<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u4fdd\u7559\u5230\u7a0b\u5e8f\u8fd0\u884c\u65f6\u671f<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">@Inherited<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6307\u5b9a\u65b0\u6ce8\u89e3\u6807\u6ce8\u5728\u7236\u7c7b\u4e0a\u65f6\u53ef\u88ab\u5b50\u7c7b\u7ee7\u627f<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">public @interface TestName {<br style=\"box-sizing: border-box;\" \/>\u00a0 \u00a0String name();<br style=\"box-sizing: border-box;\" \/>}<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u81ea\u5b9a\u4e49\u6ce8\u89e3 \u8fd0\u884c \uff1a\u53cd\u5c04+aop<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u89e3\u7684Target<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">TYPE\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u7c7b\u3001\u63a5\u53e3\uff08\u5305\u62ec\u6ce8\u89e3\u7c7b\u578b\uff09\u548c\u679a\u4e3e\u7684\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">FIELD\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5b57\u6bb5\u58f0\u660e\uff08\u5305\u62ec\u679a\u4e3e\u5e38\u91cf\uff09<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">METHOD\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u65b9\u6cd5\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">PARAMETER\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u53c2\u6570\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">CONSTRUCTOR\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6784\u9020\u51fd\u6570\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">LOCAL_VARIABLE\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u672c\u5730\u53d8\u91cf\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">ANNOTATION_TYPE\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u89e3\u7c7b\u578b\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">PACKAGE\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5305\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">TYPE_PARAMETER\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u7c7b\u578b\u53c2\u6570\u58f0\u660e\uff0cJavaSE8\u5f15\u8fdb\uff0c\u53ef\u4ee5\u5e94\u7528\u4e8e\u7c7b\u7684\u6cdb\u578b\u58f0\u660e\u4e4b\u5904<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">TYPE_USE\uff1a<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">JavaSE8\u5f15\u8fdb\uff0c\u6b64\u7c7b\u578b\u5305\u62ec\u7c7b\u578b\u58f0\u660e\u548c\u7c7b\u578b\u53c2\u6570\u58f0\u660e<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u83b7\u53d6\u6ce8\u89e3\u4fe1\u606f<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 1.\u83b7\u53d6\u5f53\u524d\u7c7b\u4e0a\u7684\u6ce8\u89e3<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Class&lt;?&gt; aClass = Class.forName(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"lll.xxh.annotation.UserEntity\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 2.\u83b7\u53d6\u5f53\u524d\u65b9\u6cd5\u4e0a\u7684\u6ce8\u89e3\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Method userNameMethod = aClass.getDeclaredMethod(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"getUserName\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">TestName declaredAnnotation = userNameMethod.getDeclaredAnnotation(TestName.class);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(declaredAnnotation);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 3.\u83b7\u53d6\u5b57\u6bb5\u4e0a\u7684\u6ce8\u89e3<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Field pubUserName = aClass.getDeclaredField(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"userName\"<\/span>);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">declaredAnnotation = pubUserName.getDeclaredAnnotation(TestName.class);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(declaredAnnotation);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ 4.\u83b7\u5f97\u6784\u9020\u65b9\u6cd5\u6ce8\u89e3<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u5148\u83b7\u5f97\u6784\u9020\u65b9\u6cd5\u5bf9\u8c61<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">Constructor&lt;?&gt; constructor = aClass.getConstructor(<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">new<\/span> Class[]{});<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u62ff\u5230\u6784\u9020\u65b9\u6cd5\u4e0a\u9762\u7684\u6ce8\u89e3\u5b9e\u4f8b<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">declaredAnnotation = constructor.getAnnotation(TestName.class);<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">System.out.println(declaredAnnotation);<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin-top: 10px; margin-bottom: 10px; text-align: center; box-sizing: border-box;\">\n<section style=\"padding: 3px; display: inline-block; border-bottom: 1px solid #5f9cef; text-align: justify; font-size: 20px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u6ce8\u89e3\u5b9e\u73b0\u6848\u4f8b<\/p>\n<\/section>\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u81ea\u5b9a\u4e49\u9650\u6d41\u6ce8\u89e3<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5bf9\u6211\u4eec\u63a5\u53e3\u5b9e\u73b0 \u9650\u6d41 \u6bd4\u5982 \u6bcfs \u53ea\u80fd\u8bbf\u95ee1\u6b21 \u6216\u8005\u6bcfs \u8bbf\u95ee\u4e24\u6b21\u3002<\/p>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">Maven<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">&lt;parent&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;version&gt;<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2.2<\/span><span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">.1<\/span>.RELEASE&lt;\/version&gt;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">&lt;\/parent&gt;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">&lt;dependencies&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;!-- \u00a0springboot \u6574\u5408web\u7ec4\u4ef6--&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;\/dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;groupId&gt;com.google.guava&lt;\/groupId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;artifactId&gt;guava&lt;\/artifactId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;version&gt;<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">18.0<\/span>&lt;\/version&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;\/dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;artifactId&gt;spring-boot-starter-aop&lt;\/artifactId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;\/dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;dependency&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;groupId&gt;org.apache.commons&lt;\/groupId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;artifactId&gt;commons-lang3&lt;\/artifactId&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0&lt;version&gt;<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">3.12<\/span><span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">.0<\/span>&lt;\/version&gt;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0&lt;\/dependency&gt;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">&lt;\/dependencies&gt;<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u4f7f\u7528\u8c37\u6b4c\u7684guava\u4f8b\u5b50<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/**<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\"> * \u6bcf\u79d2\u751f\u62102.0\u4e2a\u4ee4\u724c<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\"> *\/\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> RateLimiter rateLimiter = RateLimiter.create(<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2.0<\/span>);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@GetMapping(\"\/get\")\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@TestName(name = \"get\", token = 1)\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">get<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">boolean<\/span> result = rateLimiter.tryAcquire();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">if<\/span> (!result) {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\u5f53\u524d\u8bbf\u95ee\u4eba\u6570\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5!\"<\/span>;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"this is get\"<\/span>;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin-top: 10px; margin-bottom: 10px; text-align: center; box-sizing: border-box;\">\n<section style=\"padding: 3px; display: inline-block; border-bottom: 1px solid #5f9cef; text-align: justify; font-size: 20px; box-sizing: border-box;\">\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\u5c01\u88c5\u81ea\u5b9a\u4e49\u6ce8\u89e3\u9650\u6d41\u6846\u67b6<\/p>\n<\/section>\n<\/section>\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u6574\u5408Aop\u5b9e\u73b0\u63a5\u53e3\u9650\u6d41<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Aspect\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Component\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">CurrentLimitAop<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/**<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 * \u6bcf\u79d2\u751f\u62101.0\u4e2a\u4ee4\u724c \u6bcfs\u4ea7\u751f10 token<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 *\/\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">private<\/span> ConcurrentHashMap&lt;String, RateLimiter&gt; rateLimiters = <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">new<\/span> ConcurrentHashMap();<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@Around(value = \"@annotation(lll.xxh.annotation.TestName)\")\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> Object <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">around<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">(ProceedingJoinPoint joinPoint)<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">try<\/span> {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  <span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/\u83b7\u53d6\u62e6\u622a\u7684\u65b9\u6cd5\u540d\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Signature sig = joinPoint.getSignature();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/\u83b7\u53d6\u62e6\u622a\u7684\u65b9\u6cd5\u540d\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0MethodSignature methodSignature = (MethodSignature) sig;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u5224\u65ad\u65b9\u6cd5\u4e0a\u662f\u5426\u6709\u52a0\u4e0a\u8be5\u6ce8\u89e3\uff0c\u5982\u679c\u6709\u52a0\u4e0a\u6ce8\u89e3\u5219\u9650\u6d41\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0TestName testName =<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">methodSignature.getMethod().getDeclaredAnnotation(TestName.class);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">if<\/span> (testName == <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">null<\/span>) {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u6267\u884c\u76ee\u6807\u65b9\u6cd5\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> joinPoint.proceed();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0  <span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u83b7\u53d6\u6ce8\u89e3\u4e0a\u7684name\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0String name = testName.name();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u83b7\u53d6\u6ce8\u89e3\u4e0a\u7684token\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">double<\/span> token = testName.token();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0RateLimiter rateLimiter = rateLimiters.get(name);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">if<\/span> (rateLimiter == <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">null<\/span>) {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0rateLimiter = RateLimiter.create(token);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0rateLimiters.put(name, rateLimiter);\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">\/\/ \u5f00\u59cb\u9650\u6d41\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">boolean<\/span> result = rateLimiter.tryAcquire();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">if<\/span> (!result) {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\u5f53\u524d\u8bbf\u95ee\u4eba\u6570\u8fc7\u591a\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5!\"<\/span>;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> joinPoint.proceed();\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0} <span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">catch<\/span> (Throwable throwable) {\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\u7cfb\u7edf\u51fa\u73b0\u4e86\u9519\u8bef!\"<\/span>;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0}\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">\n<section style=\"display: flex; flex-flow: row nowrap; margin: 10px 0%; justify-content: flex-start; box-sizing: border-box;\">\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: top; width: auto; flex: 0 0 auto; align-self: stretch; min-width: 10%; max-width: 100%; height: auto; margin: 0px 10px; line-height: 0; padding: 0px; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"font-size: 18px; text-align: center; color: #444444; line-height: 1; letter-spacing: 0px; box-sizing: border-box;\">\n<p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\">\u4f7f\u7528\u6548\u679c<\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block; vertical-align: middle; width: auto; align-self: center; flex: 100 100 0%; box-sizing: border-box;\">\n<section style=\"margin: 0px 0%; box-sizing: border-box;\">\n<section style=\"background-color: #444444; height: 1px; box-sizing: border-box;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@RestController\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> <span class=\"code-snippet__class\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">class<\/span> <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">TestController<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@GetMapping(\"\/get\")\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@TestName(name = \"get\", token = 1)\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">get<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span> <\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"this is get\"<\/span>;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@GetMapping(\"\/add\")\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__meta\" style=\"box-sizing: border-box;\">@TestName(name = \"add\", token = 10)\n<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0<span class=\"code-snippet__function\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">public<\/span> String <span class=\"code-snippet__title\" style=\"box-sizing: border-box;\">add<\/span><span class=\"code-snippet__params\" style=\"box-sizing: border-box;\">()<\/span><\/span>{\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0 \u00a0 \u00a0<span class=\"code-snippet__keyword\" style=\"box-sizing: border-box;\">return<\/span> <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"this is add\"<\/span>;\n<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> \u00a0 \u00a0}<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">}<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u4ed6\u5bb6\u7684\u5c0f\u670b\u53cb<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>1 \u53cd\u5c04\u673a\u5236 \u5b9a\u4e49 \u901a\u8fc7\u53cd\u5c04\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u83b7\u5f97\u7a0b\u5e8f\u6216\u7a0b\u5e8f\u96c6\u4e2d\u6bcf\u4e00\u4e2a\u7c7b\u578b\u7684\u6210\u5458\u548c\u6210\u5458\u7684\u4fe1\u606f\u3002\u7a0b\u5e8f\u4e2d\u4e00\u822c\u7684\u5bf9\u8c61\u7684\u7c7b\u578b\u90fd\u662f\u5728\u7f16\u8bd1\u671f\u5c31 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":374,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450-300x179.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450-300x179.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528005044450.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2023-05-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":292,"next_post_id":411,"next_post_title":"\u8be6\u89e3 23 \u79cd\u8bbe\u8ba1\u6a21\u5f0f\uff08\u591a\u56fe + \u4ee3\u7801\uff09","previous_post_id":279,"previous_post_title":"RabbitMQ \u6709\u54ea\u51e0\u79cd\u6d88\u606f\u6a21\u5f0f\uff1f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/374"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}