{"id":1395,"date":"2022-01-28T18:42:15","date_gmt":"2022-01-28T10:42:15","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1395"},"modified":"2024-01-10T14:34:58","modified_gmt":"2024-01-10T06:34:58","slug":"%e7%90%86%e8%a7%a3java%e6%b3%a8%e8%a7%a3%e4%b8%8e%e5%8f%8d%e5%b0%84%e8%bf%99%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f%e4%ba%86%e8%bf%91%e4%b8%87%e5%ad%97%e5%bb%ba%e8%ae%ae%e6%94%b6%e8%97%8f%ef%bc%89","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/%e7%90%86%e8%a7%a3java%e6%b3%a8%e8%a7%a3%e4%b8%8e%e5%8f%8d%e5%b0%84%e8%bf%99%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f%e4%ba%86%e8%bf%91%e4%b8%87%e5%ad%97%e5%bb%ba%e8%ae%ae%e6%94%b6%e8%97%8f%ef%bc%89\/","title":{"rendered":"\u7406\u89e3Java\u6ce8\u89e3\u4e0e\u53cd\u5c04\u8fd9\u4e00\u7bc7\u5c31\u591f\u4e86(\u8fd1\u4e07\u5b57,\u5efa\u8bae\u6536\u85cf\uff09"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;white-space: normal;color: black;padding-right: 10px;padding-left: 10px;word-break: break-word;word-wrap: break-word;text-align: left;line-height: 1.25;font-family: Optima-Regular, Optima, PingFangTC-Light, PingFangSC-light, PingFangTC-light;letter-spacing: 2px;background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%);background-size: 20px 20px;background-position: center center;\">\n<h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 25px;\"><span style=\"display: inline-block;color: rgb(119, 48, 152);\">Java\u6ce8\u89e3\u4e0e\u53cd\u5c04<\/span><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u524d\u8a00<\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u672c\u7ae0\u8282\u4e3b\u5c5e\u4e8eJava\u8fdb\u9636\u90e8\u5206,\u5982\u679c\u4f60\u521a\u63a5\u89e6Java\u6216\u8005\u5b8c\u5168\u6ca1\u6709\u7f16\u7a0b\u57fa\u7840\uff0c\u4e0d\u5efa\u8bae\u9605\u8bfb\u8fd9\u90e8\u5206\u5185\u5bb9\uff0c\u53ef\u4ee5\u8fd4\u56de\u4e0a\u4e00\u7ae0\u8282&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u57fa\u7840\u90e8\u5206<\/span>\u300d<\/strong>&nbsp;\u5185\u5bb9\u7684\u8bb2\u89e3\uff0c\u672c\u7bc7\u5185\u5bb9\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206:<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u4ec0\u4e48\u662f\u6ce8\u89e3<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u53cd\u5c04\u53ef\u4ee5\u7528\u6765\u5e72\u561b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u9762\u5411\u5207\u9762\u7f16\u7a0b\uff08\u5305\u62ecSpring\u63d0\u4f9b\u7684aop\u7684\u4f7f\u7528\uff09<\/section>\n<\/li>\n<\/ul>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u6ce8\u89e3<\/span><\/h2>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u4f55\u4e3a\u6ce8\u89e3<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6bd4\u8f83\u62bd\u8c61\u7684\u7406\u89e3\u5c31\u662f\uff0c\u7528\u6765\u6807\u8bb0\u7a0b\u5e8f\u7684\uff0c\u8fd9\u4e9b\u6807\u8bb0\u5728\u7c7b\u52a0\u8f7d\uff0c\u7f16\u8bd1\uff0c\u8fd0\u884c\u65f6\u88ab\u8bfb\u53d6\uff0c\u6700\u540e\u505a\u51fa\u76f8\u5e94\u7684\u5904\u7406\u3002\u6ce8\u89e3\u7684\u672c\u8eab\u5176\u5b9e\u4e5f\u662f\u4e00\u79cd\u914d\u7f6e\uff0c\u5728\u4f20\u7edf\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u4f1a\u901a\u8fc7\u5404\u79cd\u914d\u7f6e\u6587\u4ef6\u6bd4\u5982<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">xml,yml<\/code>\u8fd9\u4e9b\u6587\u4ef6\u6765\u914d\u7f6e\u6211\u4eec\u7684\u7a0b\u5e8f\uff0c\u5f53\u5927\u91cf\u914d\u7f6e\u65f6\uff0c\u65e0\u7591\u4ee3\u7801\u53ef\u8bfb\u6027\u4f1a\u5f88\u5dee\u3002\u901a\u8fc7\u6ce8\u89e3\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u7ed9\u7a0b\u5e8f\u6253\u4e0a\u6807\u7b7e\uff0c\u5f88\u6e05\u695a\u7684\u8868\u660e\u5b83\u662f\u5e72\u561b\u7528\u3002\u770b\u4e00\u4e2a\u6ce8\u89e3\u7684\u4f8b\u5b50:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@RestController<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@RequestMapping<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\/api\"<\/span>)<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">ConsumeController<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@RequestMapping<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\/hello\/user\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@ResponseBody<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;User&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;userService.hello();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5982\u679c\u4f60\u5b66\u8fc7&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">SpringBoot<\/span>\u300d<\/strong>, \u90a3\u4e48\u80af\u5b9a\u4e0d\u4f1a\u964c\u751f\uff0c\u8be5\u90e8\u5206\u6ce8\u89e3\u662fspring\u6846\u67b6\u63d0\u4f9b\u7684\uff0c\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684Api\u63a5\u53e3\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u7c7b\u548c\u65b9\u6cd5\u90fd\u88ab\u6253\u4e0a\u4e86&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">```@``<\/span>\u300d<\/strong>&nbsp;\u8fd9\u6837\u7684\u7b26\u53f7\uff0c\u8fd9\u5c31\u662f\u6ce8\u89e3\u7684\u6807\u8bb0\uff0c\u4e0a\u8fb9\u7684\u4ee3\u7801\u8fd9\u91cc\u4e0d\u505a\u8fc7\u591a\u89e3\u91ca\uff0c\u540e\u8fb9\u4f1a\u6709\u4e13\u95e8\u7684\u6587\u7ae0\u8bb2\u8fd9\u4e00\u90e8\u5206\u7684\u5185\u5bb9\uff0c\u8fd9\u91cc\u53ea\u9700\u8981\u77e5\u9053\u4f7f\u7528\u6ce8\u89e3\u65f6\uff0c\u5b83\u5927\u6982\u662f\u5565\u6837\u5b50\u7684\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u624b\u5199\u4e00\u4e2a\u6ce8\u89e3<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u5148\u770b\u4e00\u4e2a\u5b8c\u6574\u7684\u6ce8\u89e3\u5b9a\u4e49:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Target<\/span>(ElementType.TYPE)&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u53ef\u4f5c\u7528\u7c7b\u63a5\u53e3\u679a\u4e3e<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Retention<\/span>(RetentionPolicy.RUNTIME)&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd0\u884c\u65f6<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Inherited<\/span>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u53ef\u7ee7\u627f<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Documented<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@interface<\/span>&nbsp;Log1&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">info<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/>}<br  \/><\/code><\/pre>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">@Target(ElementType.TYPE)<\/span>\u300d<\/strong>&nbsp;\u8868\u793a\u4f5c\u7528\u7684\u7c7b\u578b\uff0c TYPE\u8fd9\u91cc\u8868\u793a\u53ef\u4f5c\u7528\u5728\u7c7b\u3001\u63a5\u53e3\u3001\u679a\u4e3e\u8eab\u4e0a<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">@Retention(RetentionPolicy.RUNTIME)<\/span>\u300d<\/strong>&nbsp;\u8868\u793a\u4f5c\u7528\u5728\u8fd0\u884c\u65f6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">@Inherited<\/span>\u300d<\/strong>&nbsp;\u8868\u660e\u53ef\u7ee7\u627f\uff0cSpring\u6e90\u7801\u4e2d\u6709\u51fa\u73b0\u8fc7\uff0c\u8fd8\u53ef\u4ee5\u8ddf&nbsp;&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c@AliasFor(value=\"xx\")\u300d<\/strong>&nbsp;\u7ed3\u5408\u53bb\u4f7f\u7528,\u540e\u8fb9\u4e5f\u4f1a\u4e3e\u4f8b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">@Documented<\/span>\u300d<\/strong>&nbsp;\u8868\u793a\u662f\u5426\u751f\u6210Java doc\uff0c\u4e00\u822c\u6211\u4eec\u90fd\u4f1a\u628a\u5b83\u52a0\u4e0a<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">@interface<\/span>\u300d<\/strong>&nbsp;\u8bed\u6cd5\u58f0\u660e\uff0c\u6ca1\u5565\u597d\u8bf4\u7684<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">String info() default \"\";<\/span>\u300d<\/strong>&nbsp;\u8fd9\u91cc\u8981\u8bf4\u660e\u4e00\u4e0b\uff0c\u8fd9\u4e2a\u4e0d\u662fLog1\u6ce8\u89e3\u7684\u65b9\u6cd5\uff0c\u5b83\u662f\u5b83\u7684\u4e00\u4e2a\u5c5e\u6027\uff0c\u4f60\u53ef\u4ee5\u7406\u89e3\u4e3a\u5b57\u6bb5\uff0cString\u8868\u660e\u7c7b\u578b\uff0c default\u662f\u9ed8\u8ba4\u503c\u3002<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u4f7f\u7528\u6ce8\u89e3<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u5b9a\u4e49\u597d\u4e86\u4ee5\u540e\uff0c\u600e\u4e48\u53bb\u4f7f\u7528\u5b83\u5462\uff1f\u5f88\u7b80\u5355\uff0c \u53ea\u9700\u8981\u5728\u5177\u4f53\u7684\u7c7b\u4e0a\u52a0\u4e0a\u6211\u4eec\u5b9a\u4e49\u7684\u6ce8\u89e3\u5373\u53ef\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Log<\/span>1(info&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"info\"<\/span>)<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">AnnoTest<\/span>&nbsp;<\/span>{}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6216\u8bb8\u4f60\u8fd8\u6709\u7591\u95ee\u2753\uff0c\u6211\u52a0\u4e0a\u4e86\u597d\u50cf\u6ca1\u5565\u6548\u679c\u554a\uff0c \u4e0d\u6025\uff0c\u8fd9\u5c31\u662f\u6211\u8981\u8bb2\u7684\u4e0b\u4e00\u4e2a\u73af\u8282&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u53cd\u5c04<\/span>\u300d<\/strong><\/p>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"700\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"700\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u653e\u8fc7\u6211<\/figcaption><\/figure>\n<p><readmore data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/p>\n<h2 style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u53cd\u5c04<\/span><\/h2>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u4f55\u4e3a\u53cd\u5c04<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u53cd\u5c04<\/span>\u300d<\/strong>&nbsp;\u4ece\u5b57\u9762\u610f\u601d\u6765\u770b\uff0c\u610f\u601d\u662f\u8bf4\u4e0d\u662f\u4ece\u6b63\u9762\u800c\u662f\u4ece\u53cd\u9762...<\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.918\"  data-type=\"jpeg\" data-w=\"1000\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042620671.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.918\"  data-type=\"jpeg\" data-w=\"1000\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042620671.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u61a8\u6279<\/figcaption><\/figure>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u641e\u9519\u4e86\uff0c\u6211\u4eec\u4ece\u4e00\u4e2a\u4f8b\u5b50\u6765\u4f53\u4f1a\u4e00\u4e0b(java\u5185\u7f6e\u53cd\u5c04)\uff1a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">reflect<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5185\u7f6e\u53cd\u5c04<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Class&lt;?&gt;&nbsp;annoClass&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">try<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u5bf9\u8c61<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annoClass&nbsp;=&nbsp;Class.forName(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"com.java.lang.base.annotation.AnnoTest\"<\/span>);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5224\u65ad\u662f\u5426\u5b58\u5728\u6ce8\u89e3log1<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">boolean<\/span>&nbsp;isAnnoLog1&nbsp;=&nbsp;annoClass.isAnnotationPresent(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"anno&nbsp;log1&nbsp;exist:&nbsp;\"<\/span>&nbsp;+&nbsp;isAnnoLog1);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(isAnnoLog1)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u6ce8\u89e3<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log1&nbsp;annotation&nbsp;=&nbsp;annoClass.getAnnotation(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"info&nbsp;----\"<\/span>&nbsp;+&nbsp;annotation.info());&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">catch<\/span>(Exception&nbsp;e)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(e.getMessage());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c\u6211\u4eec\u6765\u89e3\u8bfb\u4e00\u4e0b\u4e0a\u8fb9\u7684\u4ee3\u7801, \u4e3b\u8981\u505a\u4e86\u4ee5\u4e0b\u51e0\u4e2a\u4e8b\u60c5\u300d<\/strong><\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u9996\u5148\u5b9a\u4e49\u4e86\u4e00\u4e2a&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">annoClass<\/span>\u300d<\/strong>&nbsp;\uff0c\u4e3b\u8981\u4f5c\u7528\u662f\u8d4b\u503c\u76ee\u6807\u7c7b,\u5f53\u7136\u4e5f\u53ef\u4ee5\u4e0d\u5b9a\u4e49\uff0c\u4f46\u662f\u4e3a\u4e86\u5b89\u5168\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u907f\u514d\u5f02\u5e38\uff0c\u4f7f\u7528\u4e86try,catch\u6355\u6349\u4e00\u4e0b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">Class.forName(\"com.java.lang.base.annotation.AnnoTest\")<\/span>\u300d<\/strong>&nbsp;, \u8fd9\u91cc\u901a\u8fc7\u5305\u540d\u7684\u5f62\u5f0f\u83b7\u53d6\u76ee\u6807\u7c7b\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u53ef\u4ee5\u62ff\u5230\u76ee\u6807\u7c7b\u7684\u4fe1\u606f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">annoClass.isAnnotationPresent<\/code>&nbsp;\u5224\u65ad\u8be5\u7c7b\u662f\u5426\u5b58\u5728&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">Log1<\/code>\u7684\u6ce8\u89e3\uff0c\u8fd4\u56de\u7c7b\u578b\u662f\u5e03\u5c14\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">annoClass.getAnnotation(Log1.class)<\/code>&nbsp;\u8868\u793a\u83b7\u53d6\u4f5c\u7528\u5728\u7c7b\u4e0a\u7684\u6ce8\u89e3\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">annotation.info()<\/code>&nbsp;\u83b7\u53d6\u5185\u5bb9\u4fe1\u606f\uff0c\u8fd8\u8bb0\u5f97&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@Log1(info = \"info\")<\/code>&nbsp;\u8fd9\u4e2a\u6807\u8bb0\u5417\uff1f\u8fd9\u6837\u5c31\u62ff\u5230\u4e86\u5f53\u65f6\u4f5c\u7528\u5728\u7c7b\u4e0a\u7684\u6ce8\u89e3\u539f\u4fe1\u606f<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6216\u8bb8\u4f60\u8fd8\u6709\u7591\u95ee\u2753 \u8fd9\u597d\u50cf\u4e5f\u6ca1\u5565\u7528\u554a\uff0c\u83b7\u53d6\u5230\u4fe1\u606f\uff0c \u7136\u540e\u5462\uff1f<\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"lazyload\"data-ratio=\"0.458\"  data-type=\"jpeg\" data-w=\"500\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042622270.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-ratio=\"0.458\"  data-type=\"jpeg\" data-w=\"500\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042622270.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u7591\u95ee\u4e09\u8054<\/figcaption><\/figure>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c\u6709\u7528\u554a\u300d<\/strong>&nbsp;\uff0c\u8c01\u8bf4\u6ca1\u7528\u7684\uff0c\u5982\u679c\u4f60\u6709\u8fd9\u6837\u4e00\u4e2a\u573a\u666f\uff0c\u9700\u8981\u5728\u7c7b\u6267\u884c\u7684\u65f6\u5019\uff0c\u4f60\u8981\u8bb0\u5f55\u4e00\u4e9b\u65e5\u5fd7\uff0c\u96be\u4e0d\u6210\u4f60\u8981\u7ed9\u6bcf\u4e2a\u7c7b\u90fd\u5199\u4e00\u4e2aLog\u65b9\u6cd5\u624b\u52a8\u8c03\u7528\u5417\uff1f\u6216\u8bb8\u4f60\u4f1a\u8bf4\u6211\u5199\u4e2a\u516c\u5171\u65b9\u6cd5\uff1f\u5199\u4e2a\u516c\u5171\u65b9\u6cd5\uff0c\u4f46\u662f\u600e\u4e48\u62ff\u5230\u5177\u7c7b\u7684\u4fe1\u606f\u5462\uff1f\u8fd9\u4e9b\u90fd\u662f\u95ee\u9898\uff0c\u5f53\u7136\u975e\u8981\u90a3\u6837\uff0c\u4e5f\u662f\u53ef\u4ee5\uff0c<strong style=\"color: rgb(145, 109, 213);\">\u300c\u6ce8\u89e3\u300d<\/strong>&nbsp;\u4e0d\u662f\u66f4\u5e05\u4e00\u70b9\u5417\u3002\u597d\u4e86\uff0c\u6211\u518d\u6559\u4f60\u4e00\u62db\u3002<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u53cd\u5c04\u7684\u5e94\u7528<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e3a\u4e86\u8bf4\u7684\u660e\u767d\u4e00\u70b9\uff0c\u5bf9Log1\u7684\u6ce8\u89e3\u505a\u4e00\u4e9b\u6539\u53d8\uff1a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Target<\/span>(ElementType.METHOD)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Retention<\/span>(RetentionPolicy.RUNTIME)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Inherited<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Documented<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@interface<\/span>&nbsp;Log1&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">info<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5c06&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@Target(ElementType.TYPE)<\/code>&nbsp;\u6539\u6210\u4e86&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@Target(ElementType.METHOD)<\/code>, \u901a\u8fc7\u5b57\u9762\u610f\u601d\u770b\uff0c\u53ea\u7684\u662f\u4f5c\u7528\u5230\u4e86\u65b9\u6cd5\u4e0a\uff0c\u7136\u540e\u6539\u4e00\u4e0b\u6211\u4eec\u7684\u76ee\u6807\u7c7b\uff1a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">AnnoTest<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Log<\/span>1(info=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"info\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">(String&nbsp;msg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u52a8\u6001\u8bbe\u7f6e&nbsp;---&nbsp;\"<\/span>&nbsp;+&nbsp;&nbsp;msg);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u8fd4\u56de\u503c----&gt;\"<\/span>&nbsp;+&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6539\u53d8\u4e86\u4f5c\u7528\u5bf9\u8c61\uff0c\u8fd9\u6b21\u5728\u65b9\u6cd5\u4e0a\uff0c \u6211\u4eec\u518d\u6539\u4e00\u4e0b\u53cd\u5c04\u7684\u4ee3\u7801\uff1a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">reflect<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5185\u7f6e\u53cd\u5c04<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Class&lt;?&gt;&nbsp;annoClass&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">try<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u5bf9\u8c61<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annoClass&nbsp;=&nbsp;Class.forName(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"com.java.lang.base.annotation.AnnoTest\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u65b9\u6cd5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method[]&nbsp;methods&nbsp;=&nbsp;annoClass.getDeclaredMethods();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u65b9\u6cd5\u904d\u5386:<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">for<\/span>&nbsp;(Method&nbsp;declaredMethod&nbsp;:&nbsp;methods)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5224\u65ad\u65b9\u6cd5\u662f\u5426\u5b58\u5728\u6ce8\u89e3<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">boolean<\/span>&nbsp;isAnnoLog&nbsp;=&nbsp;declaredMethod.isAnnotationPresent(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(isAnnoLog)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotation&nbsp;=&nbsp;declaredMethod.getAnnotation(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u6784\u9020\u5668<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor&lt;?&gt;&nbsp;constructor&nbsp;=&nbsp;annoClass.getConstructor();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b9e\u4f8b\u5316<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;obj&nbsp;=&nbsp;constructor.newInstance();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6267\u884c\u65b9\u6cd5&nbsp;-&nbsp;\u5c06\u6ce8\u89e3\u7684\u6570\u636e\u6267\u884c\u8fdb\u53bb<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(declaredMethod.invoke(obj,&nbsp;annotation.info()));<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">catch<\/span>(Exception&nbsp;e)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(e.getMessage());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e0a\u8ff0\u4ee3\u7801\u53d8\u5316\u5927\u7684\u5730\u65b9\u4e3b\u8981\u5728\u83b7\u53d6\u65b9\u6cd5\u90a3\u4e00\u5757\uff0c\u8bb2\u4e00\u4e0b\u5177\u4f53\u7684\u65b9\u6cd5\uff1a<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">Method[] methods = annoClass.getDeclaredMethods();<\/code>&nbsp;\u8fd9\u4e2a\u662f\u83b7\u53d6\u76ee\u6807\u7c7b\u4e0a\u5b9a\u4e49\u7684\u65b9\u6cd5<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u7d27\u63a5\u7740\u904d\u5386\u4e86\u65b9\u6cd5,&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">boolean isAnnoLog = declaredMethod.isAnnotationPresent(Log1.class);<\/code>&nbsp;\u5224\u65ad\u4e86\u65b9\u6cd5\u4e0a\u662f\u5426\u6709&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c\u6ce8\u89e3\u300d<\/strong>&nbsp;\u6807\u8bb0\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u7136\u540e\u83b7\u53d6\u4e86\u6ce8\u89e3\uff0c&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">Constructor&lt;?&gt; constructor = annoClass.getConstructor();<\/code>\u8fd9\u4e2a\u610f\u601d\u662f\u83b7\u53d6\u7c7b\u7684\u6784\u9020\u5668\uff0c\u7528\u4e8e\u4e0b\u8fb9\u7684\u5b9e\u4f8b\u5316\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">Object obj = constructor.newInstance();<\/code>&nbsp;\u5b9e\u4f8b\u5316\u7c7b\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">declaredMethod.invoke(obj, annotation.info())<\/code>&nbsp;\u610f\u601d\u662f\u6267\u884c\u5177\u4f53\u7684\u65b9\u6cd5\uff0c\u5e76\u4f20\u53c2\u3002<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u901a\u8fc7\u8fd9\u4e2a\u4f8b\u5b50\uff0c \u4f60\u53ef\u4ee5\u53d1\u73b0\uff0c\u660e\u660e\u6211\u5565\u4e5f\u6ca1\u5e72\uff0c\u4ee5\u524d\u6211\u4eec\u90fd\u662f\u5148\u5b9e\u4f8b\u5316\u5b83\u7136\u540e\u518d\u6267\u884c\uff0c\u73b0\u5728\u6362\u6210\u52a0\u4e86\u4e2a\u6ce8\u89e3\uff0c\u8fd9\u4e2a\u7c7b\u65b9\u6cd5\u5c31\u6267\u884c\u4e86\u3002\u597d\u4e86\uff0c\u5230\u8fd9\u91cc\uff0c\u6211\u89c9\u5f97\u4f60\u5bf9\u53cd\u5c04\u548c\u6ce8\u89e3\u90fd\u6709\u4e86\u4e00\u5b9a\u7684\u7406\u89e3\u4e86\u3002<\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"900\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042623334.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"900\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042623334.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u4e0d\u8981\u4f60\u89c9\u5f97<\/figcaption><\/figure>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u73b0\u5728\u603b\u7ed3\u4e00\u4e0b\u4ec0\u4e48\u662f\u53cd\u5c04:<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">::: tip \u6bcf\u4e2a\u7c7b\u90fd\u6709\u4e00\u4e2a&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cClass\u300d<\/strong>&nbsp;\u5bf9\u8c61\uff0c\u5305\u542b\u4e86\u4e0e\u7c7b\u6709\u5173\u7684\u4fe1\u606f\u3002\u5f53\u7f16\u8bd1\u4e00\u4e2a\u65b0\u7c7b\u65f6\uff0c\u4f1a\u4ea7\u751f\u4e00\u4e2a\u540c\u540d\u7684 .class \u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u5185\u5bb9\u4fdd\u5b58\u7740 Class \u5bf9\u8c61\u3002\u7c7b\u52a0\u8f7d\u76f8\u5f53\u4e8eClass \u5bf9\u8c61\u7684\u52a0\u8f7d\uff0c\u7c7b\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528\u65f6\u624d\u52a8\u6001\u52a0\u8f7d\u5230 JVM \u4e2d\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cClass.forName(\"xxx\")\u300d<\/strong>\u3002\u8fd9\u79cd\u65b9\u5f0f\u6765\u63a7\u5236\u7c7b\u7684\u52a0\u8f7d\uff0c\u8be5\u65b9\u6cd5\u4f1a\u8fd4\u56de\u4e00\u4e2a&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cClass\u300d<\/strong>&nbsp;\u5bf9\u8c61\u3002\u53cd\u5c04\u53ef\u4ee5\u63d0\u4f9b\u8fd0\u884c\u65f6\u7684\u7c7b\u4fe1\u606f\uff0c\u5e76\u4e14\u8fd9\u4e2a\u7c7b\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u624d\u52a0\u8f7d\u8fdb\u6765\uff0c\u751a\u81f3\u5728\u7f16\u8bd1\u65f6\u671f\u8be5\u7c7b\u7684&nbsp;<span style=\"color: rgb(145, 109, 213);\"><strong>\u300c.class\u300d<\/strong><\/span>&nbsp;\u4e0d\u5b58\u5728\u4e5f\u53ef\u4ee5\u52a0\u8f7d\u8fdb\u6765\u3002:::<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">Class \u548c java.lang.reflect \u4e00\u8d77\u5bf9\u53cd\u5c04\u63d0\u4f9b\u4e86\u652f\u6301\uff0cjava.lang.reflect \u7c7b\u5e93\u4e3b\u8981\u5305\u542b\u4e86\u4ee5\u4e0b\u4e09\u4e2a\u7c7b\uff1a<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">Field<\/span>\u300d<\/strong>&nbsp;\uff1a\u53ef\u4ee5\u4f7f\u7528 get() \u548c set() \u65b9\u6cd5\u8bfb\u53d6\u548c\u4fee\u6539 Field \u5bf9\u8c61\u5173\u8054\u7684\u5b57\u6bb5\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">Method<\/span>\u300d<\/strong>&nbsp;\uff1a\u53ef\u4ee5\u4f7f\u7528 invoke() \u65b9\u6cd5\u8c03\u7528\u4e0e Method \u5bf9\u8c61\u5173\u8054\u7684\u65b9\u6cd5\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">Constructor<\/span>\u300d<\/strong>&nbsp;\uff1a\u53ef\u4ee5\u7528 Constructor \u7684 newInstance() \u521b\u5efa\u65b0\u7684\u5bf9\u8c61;<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5927\u5bb6\u4e5f\u53ef\u4ee5\u8bd5\u7740\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u4e00\u4e0b\uff0c\u8fd9\u91cc\u5c31\u4e0d\u4e00\u4e00\u6f14\u793a\u4e86\u3002<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u6ce8\u89e3\u7684\u8865\u5145<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e3a\u5565\u8981\u5728\u8fd9\u4e00\u7ae0\u8282\u8865\u5145\u5462\uff1f\u56e0\u4e3a\u5b83\u9700\u8981\u501f\u52a9\u53cd\u5c04\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u7684\u7406\u89e3\u3002\u4e3b\u8981\u8865\u5145\u4ee5\u4e0b\u51e0\u4e2a\u77e5\u8bc6\u70b9:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">@\u6ce8\u89e3\u7684\u7ee7\u627f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">@\u6ce8\u89e3\u7684\u663e\u793a\u4f20\u9012\u4e0e\u9690\u5f0f\u4f20\u9012<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u4e24\u4e2a\u77e5\u8bc6\u70b9\uff0c\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\uff0c\u641e\u5b9a\u5b83:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Target<\/span>(ElementType.TYPE)&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u53ef\u4f5c\u7528\u7c7b\u63a5\u53e3\u679a\u4e3e<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Retention<\/span>(RetentionPolicy.RUNTIME)&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd0\u884c\u65f6<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Inherited<\/span>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u53ef\u7ee7\u627f<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Documented<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7ee7\u627fLog2\u6ce8\u89e3<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Log<\/span>2<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@interface<\/span>&nbsp;Log1&nbsp;{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u663e\u793a\u4f20\u9012&nbsp;\u8fd9\u91cc\u53ef\u4ee5\u63a5\u6536err\u7684\u5c5e\u6027\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u663e\u793a\u4e13\u9012\u65f6\u9700\u8981\u52a0\u4e0a&nbsp;&nbsp;@AliasFor \u53bb\u6807\u8bb0, \u5e76\u4e14default\u8981\u4e00\u81f4<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(value=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"err\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">info<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(value=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"info\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9690\u5f0f\u4f20\u9012&nbsp;-&nbsp;\u5c5e\u6027\u540d\u4ee5Log2\u7684\u5c5e\u6027\u540d<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(annotation&nbsp;=&nbsp;Log2<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">attribute<\/span>&nbsp;<\/span>=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"log2\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err1<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(annotation&nbsp;=&nbsp;Log2<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">attribute<\/span>&nbsp;<\/span>=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"log2\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err2<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/>}<br  \/><\/code><\/pre>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Target<\/span>(ElementType.TYPE)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Retention<\/span>(RetentionPolicy.RUNTIME)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Inherited<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Documented<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@interface<\/span>&nbsp;Log2&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">log2<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/>}<br  \/><\/code><\/pre>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Log<\/span>1(err1&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u9690\u5f0f\u4f20\u9012&nbsp;err1\"<\/span>)<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">AnnoTest<\/span>&nbsp;<\/span>{<br  \/><br  \/>}<br  \/><\/code><\/pre>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">reflect<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5185\u7f6e\u53cd\u5c04<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Class&lt;?&gt;&nbsp;annoClass&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">try<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u5bf9\u8c61<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annoClass&nbsp;=&nbsp;Class.forName(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"com.java.lang.base.annotation.AnnoTest\"<\/span>);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5224\u65ad\u662f\u5426\u5b58\u5728\u6ce8\u89e3log1<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">boolean<\/span>&nbsp;isAnnoLog1&nbsp;=&nbsp;annoClass.isAnnotationPresent(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"anno&nbsp;log1&nbsp;exist:&nbsp;\"<\/span>&nbsp;+&nbsp;isAnnoLog1);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log1&nbsp;annotation&nbsp;=&nbsp;annoClass.getAnnotation(Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;Log.info(\"info&nbsp;----\"&nbsp;+&nbsp;annotation.info());&nbsp;\/\/&nbsp;info&nbsp;----\u663e\u5f0f\u4f20\u9012&nbsp;info<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;aop&nbsp;\u7248\u672c\u83b7\u53d6\u6ce8\u89e3<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotation&nbsp;=&nbsp;AnnotationUtils.getAnnotation(annoClass,&nbsp;Log1<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"err1&nbsp;----\"<\/span>&nbsp;+&nbsp;annotation.err1());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9690\u5f0f\u4f20\u9012&nbsp;err1<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"err2&nbsp;----\"<\/span>&nbsp;+&nbsp;annotation.err2());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5f0f\u4f20\u9012&nbsp;err2&nbsp;-&nbsp;\u53d1\u73b0err2&nbsp;\u5e76\u6ca1\u6709\u4f20\u5165\u5c5e\u6027\u503c&nbsp;-&nbsp;@Log1(err1&nbsp;=&nbsp;\"\u9690\u5f0f\u4f20\u9012&nbsp;err1\")<\/span><br  \/><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">catch<\/span>(Exception&nbsp;e)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(e.getMessage());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color: rgb(145, 109, 213);\"><strong>\u300c\u8bf4\u4eba\u8bdd\u300d<\/strong><\/span><\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"700\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042624819.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"700\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042624819.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u653e\u8fc7\u6211<\/figcaption><\/figure>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8d34\u4e86\u8fd9\u51e0\u6bb5\u4ee3\u7801\uff0c\u61f5\u903c\u5f88\u7406\u89e3\u3002\u73b0\u5728\u5c31\u6765\u89e3\u8bfb\u4e00\u4e0b\uff0c\u6ce8\u89e3\u7ee7\u627f\u6ca1\u5565\u597d\u8bf4\u7684\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f5c\u7528\u5728\u6ce8\u89e3\u8eab\u4e0a\uff0c\u8ddf\u7c7b\u4e00\u6837\u53ef\u4ee5\u83b7\u53d6\u5b83\u3002\u4e3b\u8981\u8bf4\u8bf4\u5b83\u7684\u5c5e\u6027\u4f20\u9012\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color: rgb(145, 109, 213);\"><strong>\u300c\u5148\u8bf4@\u6ce8\u89e3\u663e\u5f0f\u4f20\u9012:\u300d<\/strong><\/span><\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(value=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"err\"<\/span>)<br  \/><span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">info<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(value=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"info\"<\/span>)<br  \/><span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u4e2a<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@AliasFor<\/code>\u4f5c\u7528\u5c31\u662f\u4f20\u9012\u5c5e\u6027\uff0c<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">value=\"err\"<\/code>&nbsp;\u8868\u793a\u663e\u793a\u7684\u4f20\u9012\uff0c<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">err<\/code>\u5c31\u662f\u4ee3\u8868<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">String err() default \"\";<\/code>\u8fd9\u4e00\u4e2a\u5c5e\u6027\u3002\u4f5c\u7528\u662f\u4ec0\u4e48\u5462\uff1f\u4f5c\u7528\u5728\u4e8e\u5982\u679c\u6211\u7ed9<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">info<\/code>\u5b57\u6bb5\u4f20\u4e86\u503c\uff0c<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">err<\/code>\u6ca1\u6709\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u9ed8\u8ba4\u7684\u4f20\u9012\u5230&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">String err() default \"\";<\/code>\u8fd9\u4e2a\u5c5e\u6027\u8eab\u4e0a\uff0c\u5982\u679c\u6709\u70b9\u62bd\u8c61,\u53ef\u4ee5\u63a7\u5236\u53f0\u8f93\u51fa\u4e00\u4e0b\uff0c\u4f60\u5c31\u4f1a\u660e\u767d\u4e86\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color: rgb(145, 109, 213);\"><strong>\u300c@\u6ce8\u89e3\u9690\u5f0f\u4f20\u9012:\u300d<\/strong><\/span><\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9690\u5f0f\u4f20\u9012&nbsp;-&nbsp;\u5c5e\u6027\u540d\u4ee5Log2\u7684\u5c5e\u6027\u540d<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(annotation&nbsp;=&nbsp;Log2<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">attribute<\/span>&nbsp;<\/span>=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"log2\"<\/span>)<br  \/><span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err1<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AliasFor<\/span>(annotation&nbsp;=&nbsp;Log2<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">attribute<\/span>&nbsp;<\/span>=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"log2\"<\/span>)<br  \/><span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">err2<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u53ef\u4ee5\u76f4\u89c2\u7684\u770b\u5230\u8ddf\u4e0a\u8fb9\u7684\u6ce8\u89e3\u4e0d\u4e00\u6837,&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">annotation = Log2.class, attribute = \"log2\"<\/code>\u8fd9\u4e00\u5757\u4e0d\u4e00\u6837\uff0c\u5565\u610f\u601d\u5462\uff1f\u8bf4\u7684\u662f\u7ee7\u627f\u4e86Log2\u7684\u5c5e\u6027\u540d<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">log2<\/code>\uff0c\u4f60\u4f1a\u53d1\u73b0\u8ddf\u521a\u521a\u7684\u4e0d\u4e00\u6837\uff0c\u521a\u521a\u7684<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">value<\/code>\u4e24\u4e2a\u90fd\u4e0d\u4e00\u6837\u554a\u3002\u8fd9\u4e2a\u5c31\u662f\u9690\u5f0f\u4f20\u9012\u7684\u597d\u5904\u3002\u5f53\u6211\u4eec\u4e0b\u6b21\u4f5c\u7528\u5230\u7c7b\u4e0a\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u7701\u53bb\u5199\u5c5e\u6027\u540d\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd9\u6837<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@Log(\"hh\")<\/code>\u3002\u5982\u679c\u4f60\u5b66\u8fc7<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">spring<\/code>\u4f60\u4f1a\u53d1\u73b0\u5f88\u591a\u6ce8\u89e3\u4f60\u5728\u7528\u7684\u65f6\u5019\u90fd\u6ca1\u52a0\u5c5e\u6027\u540d\uff0c\u4e0d\u5982<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">@Value(\"xxxx\")<\/code>\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u8ddf\u4e0a\u8fb9\u7684\u4e00\u6837\uff0c\u53ef\u4ee5\u4e92\u76f8\u4f20\u9012\u5c5e\u6027\u503c\u3002<\/p>\n<h2 style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">AOP<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5176\u5b9e\u8fd9\u4e00\u8282\u662f\u5bf9\u4e0a\u4e00\u8282\u7684\u8865\u5145\u4e0e\u603b\u7ed3\uff0c<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>&nbsp;\u662fAspect Oriented Program\u7684\u9996\u5b57\u6bcd\u7f29\u5199, \u7b80\u79f0&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u9762\u5411\u5207\u9762<\/span>\u300d<\/strong>&nbsp;\u7f16\u7a0b\u3002\u6211\u4eec\u4e4b\u524d\u4ecb\u7ecd\u8fc7&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u9762\u5411\u5bf9\u8c61<\/span>\u300d<\/strong>&nbsp;\u7f16\u7a0b\uff0c \u9762\u5411\u5bf9\u8c61\u7684\u7279\u5f81\uff1a<strong style=\"color: rgb(145, 109, 213);\">\u300c\u7ee7\u627f\u3001\u591a\u6001\u548c\u5c01\u88c5\u300d<\/strong>, \u597d\u5bb6\u4f19\u53c8\u6765\u4e86\u4e00\u65b0\u540d\u8bcd\u3002\u4e0b\u9762\u6211\u901a\u8fc7\u6700\u76f4\u767d\u7684\u8bdd\u544a\u8bc9\u4f60\u5565\u662f&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300caop\u300d<\/strong>\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">::: tip \u53e6\u5916\u8865\u5145\u4e00\u4e0b\u8bcd\u6c47&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>&nbsp;\u5c31\u662f\u6240\u8bf4\u7684\u9762\u5411\u5bf9\u8c61 :::<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u4f55\u4e3aAOP<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e3e\u4e00\u4e2a\u9020\u6c7d\u8f66\u7684\u4f8b\u5b50\uff0c\u5728&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>&nbsp;\u601d\u60f3\u4e2d\uff0c\u9020\u4e00\u4e2a\u5c0f\u6c7d\u8f66\u662f\u8fd9\u4e48\u9020\u7684\u3002<strong style=\"color: rgb(145, 109, 213);\">\u300c\u6c7d\u8f66 -&gt; \u5916\u58f3 -&gt; \u5e95\u76d8 -&gt; \u8f6e\u5b50\u300d<\/strong>,\u5047\u8bbe\u6709\u8fd9\u51e0\u90e8\u5206\uff0c\u5982\u679c\u54ea\u5929\u8001\u677f\u6709\u4e86\u65b0\u60f3\u6cd5\uff0c\u6211\u8981\u6539\u4e00\u4e0b\u8f66\u5b50\uff0c\u90a3\u662f\u4e0d\u662f\u8981\u62c6\u4e0b\u6765\uff0c\u6bcf\u4e2a\u90fd\u8981\u91cd\u65b0\u9020\uff1f\u7275\u4e00\u53d1\u52a8\u5168\u8eab\u3002\u6211\u4eec\u5199\u7a0b\u5e8f\u4e5f\u4e00\u6837\uff0c\u54ea\u5929\u4ea7\u54c1\u8bf4\u6539\u4e2a\u9700\u6c42\uff0c\u62ff\u524d\u7aef\u6765\u8bb2\uff0c\u6539\u4e2a\u6309\u94ae\u4e0d\u81f3\u4e8e\u6539\u6574\u4e2a\u9875\u9762\u7684\u6837\u5f0f\u5427\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8bf4\u5b8c&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>&nbsp;,\u6211\u4eec\u5728\u770b&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cAPO\u300d<\/strong>&nbsp;\u662f\u600e\u4e48\u9020\u8f66\u7684\uff0c&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c\u8f6e\u5b50 -&gt; \u5e95\u76d8 -&gt; \u5916\u58f3 -&gt; \u6c7d\u8f66\u300d<\/strong>\uff0c \u53d1\u73b0\u5982\u679c\u60f3\u6539\u67d0\u4e2a\u5730\u65b9\uff0c\u6211\u53ea\u9700\u8981\u5207\u5165\u5230\u5177\u4f53\u7684\u70b9\uff08<strong style=\"color: rgb(145, 109, 213);\">\u300c\u5207\u70b9\u300d<\/strong>\uff09\uff0c\u505a\u5177\u4f53\u7684\u4e8b\u5c31\u597d\u4e86\uff0c\u8fd9\u65f6\u5019\u4f60\u5c31\u53ef\u4ee5\u5bf9\u8001\u677f\u8bb2\uff0c\u4f60\u8bf4\u6539\u54ea\u5427\uff1f\u4eca\u665a\u5c31\u7ed9\u4f60\u641e\u5b9a\uff0c\u7d27\u63a5\u7740\u8001\u677f\u7ed9\u4f60\u6da8\u4e86\u5de5\u8d44\u3002<\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.9890625\"  data-type=\"jpeg\" data-w=\"640\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042625936.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.9890625\"  data-type=\"jpeg\" data-w=\"640\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042625936.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u591a\u559d\u70ed\u6c34<\/figcaption><\/figure>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5176\u5b9e\u8fd9\u4e2a\u4f8b\u5b50\u5462\uff0c\u8fd8\u5f15\u7533\u4e86\u53e6\u5916\u4e24\u4e2a\u6982\u5ff5\uff0c \u4e00\u4e2a\u662f&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c\u4f9d\u8d56\u5012\u7f6e\u300d<\/strong>\uff0c \u53e6\u4e00\u4e2a\u662f&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u63a7\u5236\u53cd\u8f6c\uff08Inversion of Control\uff09\u7b80\u79f0\u5c31\u662fIOC<\/span>\u300d<\/strong>, \u597d\u5bb6\u4f19\u53c8\u5b66\u4e86\u65b0\u8bcd\u6c47\u3002\u5982\u679c\u5b66\u8fc7&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cSpring\u300d<\/strong>&nbsp;\u4e00\u5b9a\u4e0d\u4f1a\u964c\u751f\uff0c\u6ca1\u9519\u5b83\u5c31\u662f&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cSpring\u300d<\/strong>&nbsp;\u6846\u67b6\u7684\u6838\u5fc3\u90e8\u5206\uff0c\u4e5f\u662f\u9762\u8bd5\u4e2d\u5e38\u95ee\u7684\u95ee\u9898\u3002\u8fd9\u91cc\u5462\uff0c\u4e0d\u505a\u8fc7\u591a\u7684\u4ecb\u7ecd\uff0cSpring\u6e90\u7801\u6ca1\u770b\u61c2\uff0c\u6ca1\u5173\u7cfb\uff0c\u5148\u628a\u6982\u5ff5\u7406\u6e05\u695a\u4e86\u3002\u5176\u4e2d\u7279\u522b\u559c\u6b22\u77e5\u4e4e\u7684\u4e00\u4e2a\u56de\u7b54\uff0c\u5982\u679c\u60f3\u7406\u89e3\u5565\u662fIOC\u7684\u540c\u5b66\uff0c\u53ef\u4ee5\u770b\u770b\u8fd9\u4f4d\u5927\u4f6c\u7684\u56de\u7b54&nbsp;Spring IoC\u6709\u4ec0\u4e48\u597d\u5904\u5462\uff1f\uff0c\u521a\u521a\u4e5f\u662f\u501f\u9274\u4e86\u4ed6\u7684\u4f8b\u5b50\uff0c\u6211\u89c9\u5f97\u8bb2\u7684\u4e0d\u9519\uff0c\u5206\u4eab\u7ed9\u5927\u5bb6\u3002<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u573a\u666f\u91cd\u73b0<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u56de\u5230\u6b63\u9898\uff0c\u521a\u521a\u6211\u4eec\u4e3e\u4e86\u9020\u6c7d\u8f66\u7684\u4f8b\u5b50\uff0c\u7c97\u7565\u7684\u8bb2\u4e86\u4e00\u4e0b\u8fd9\u4e2a\u6982\u5ff5\uff0c\u56de\u5230\u6211\u4eec\u4e4b\u524d\u8bb2\u7684\u6253\u65e5\u5fd7\u7684\u573a\u666f\u3002\u4e4b\u524d\u6211\u4eec\u8ba8\u8bba\u8fc7\uff0c\u4f7f\u7528\u516c\u5171\u6253\u5370\u65e5\u5fd7\u7684\u65b9\u6cd5\u4e5f\u53ef\u4ee5\uff0c\u73b0\u5728\u6211\u8981\u63d0\u95ee\u4e00\u4e2a\u95ee\u9898\uff0c\u5982\u679c\u6211\u8981\u6539\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u4f60\u80fd\u4fdd\u8bc1\u4f9d\u8d56\u7684\u7c7b\u4e0d\u53d7\u5f71\u54cd\u5417\uff1f\u663e\u7136\u4e0d\u7ba1\u5f71\u4e0d\u5f71\u54cd\uff0c\u4f60\u4e5f\u4e0d\u6562\u7acb\u9a6c\u786e\u5b9a\u5427\uff0c\u597d\u4e86\u4f60\u72b9\u8c6b\u4e86\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6362\u6210&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>&nbsp;\u7684\u65b9\u5f0f\uff0c\u4f60\u53ea\u9700\u8981\u5207\u5165\u5230\u6307\u5b9a\u7c7b\u548c\u7c7b\u7684\u65b9\u6cd5\uff0c\u505a\u4e00\u4e9b\u5904\u7406\u5c31\u597d\u4e86\uff0c\u8fd9\u79cd\u5728\u8fd0\u884c\u65f6\uff0c\u52a8\u6001\u5730\u5c06\u4ee3\u7801\u5207\u5165\u5230\u7c7b\u7684\u6307\u5b9a\u65b9\u6cd5\u3001\u6307\u5b9a\u4f4d\u7f6e\u4e0a\u7684\u7f16\u7a0b\u601d\u60f3\u5c31\u662f<strong style=\"color: rgb(145, 109, 213);\">\u300c\u9762\u5411\u5207\u9762\u300d<\/strong>\uff0c\u662f\u4e0d\u662fso easy\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u73b0\u5728\u5f88\u591a\u6d41\u884c\u7684\u6846\u67b6\u90fd\u6709\u7528\u5230<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>\u7684\u601d\u60f3\uff0c\u6bd4\u5982&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cspring-aop\u300d<\/strong>, \u4e00\u4e9b\u62e6\u622a\u5668\u7684\u6846\u67b6\uff0c\u51e0\u4e4e\u90fd\u6709\u5b83\u7684\u5f71\u5b50\u3002\u8bf4\u4e86\u8fd9\u4e48\u591a\uff0c\u4e0d\u662f\u544a\u8bc9\u5927\u5bb6&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>&nbsp;\u6ca1\u6709&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>\u5e05\uff0c\u4ee5\u540e\u5168\u7528&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>\u6765\u5199\u4ee3\u7801\uff0c\u5e05\u4e0d\u80fd\u5f53\u996d\u5403\uff0c\u5176\u5b9e&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cAOP\u300d<\/strong>\u662f&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>\u7684\u4e00\u79cd\u8865\u5145\uff0c\u5f25\u8865\u4e86<strong style=\"color: rgb(145, 109, 213);\">\u300cOOP\u300d<\/strong>\u4e2d\u4e00\u4e9b\u4e0d\u8db3\u7684\u5730\u65b9\uff0c\u76ee\u7684\u90fd\u662f\u4e3a\u4e86\u8ba9\u6211\u4eec\u7684\u7a0b\u5e8f\u66f4\u52a0\u7684\u5065\u58ee\uff0c\u987a\u4fbf\u63d2\u4e00\u5634\uff0c\u6211\u4eec\u8981\u675c\u7edd\u82b1\u91cc\u80e1\u54e8\u7684\u7f16\u7801\u65b9\u5f0f\uff0c\u628a\u5751\u5c3d\u91cf\u7559\u7684\u5c0f\u4e00\u4e9b\u3002<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">Spring\u4e2d\u7684aop\u662f\u5982\u4f55\u4f7f\u7528\u7684<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><strong style=\"color: rgb(145, 109, 213);\">\u300cspring-aop\u300d<\/strong>&nbsp;\u5e2e\u6211\u4eec\u5c01\u88c5\u4e86\u5f88\u591a\u7684\u529f\u80fd,\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u6848\u4f8b\uff0c\u6765\u770b\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528\u5b83\uff0c\u5982\u679c\u4f60\u8fd8\u6ca1\u5b66\u8fc7&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300cSpring\u300d<\/strong>&nbsp;\u53ef\u4ee5\u4e86\u89e3\u4e0b\uff0c\u76f8\u5173\u7684\u6ce8\u91ca\u6211\u5df2\u7ecf\u52a0\u5728\u4e86\u4ee3\u7801\u91cc\u3002<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Target<\/span>(ElementType.METHOD)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Retention<\/span>(RetentionPolicy.RUNTIME)<br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Inherited<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Documented<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@interface<\/span>&nbsp;Log3&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>&nbsp;\"\"<\/span>;<br  \/>}<br  \/><\/code><\/pre>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042617484.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Aspect<\/span><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Component<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">SpringAopMain<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5207\u70b9<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Pointcut<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"@annotation(com.java.lang.base.annotation.Log3)\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">aspect<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/\u914d\u7f6e\u524d\u7f6e\u901a\u77e5,\u4f7f\u7528\u5728\u65b9\u6cd5aspect()\u4e0a\u6ce8\u518c\u7684\u5207\u5165\u70b9<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/\u540c\u65f6\u63a5\u53d7JoinPoint\u5207\u5165\u70b9\u5bf9\u8c61,\u53ef\u4ee5\u6ca1\u6709\u8be5\u53c2\u6570<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Before<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aspect()\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">Before<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"before&nbsp;....\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u540e\u7f6e\u901a\u77e5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@After<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aspect()\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">After<\/span><span style=\"line-height: 26px;\">(JoinPoint&nbsp;point)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"after&nbsp;....\"<\/span>&nbsp;+&nbsp;point.toString());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6700\u7ec8\u901a\u77e5&nbsp;-&nbsp;\u8bbe\u5b9a\u8fd4\u56de\u503c\u4e3aString\u5bf9\u8c61<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AfterReturning<\/span>(pointcut&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aspect()\"<\/span>,&nbsp;returning&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"res\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">AfterReturning<\/span><span style=\"line-height: 26px;\">(String&nbsp;res)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"----AfterReturning\u65b9\u6cd5\u5f00\u59cb\u6267\u884c:---\"<\/span>+res);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/\u5f02\u5e38\u901a\u77e5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@AfterThrowing<\/span>(pointcut=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aspect()\"<\/span>,throwing=<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"e\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">AfterThrowing<\/span><span style=\"line-height: 26px;\">(Throwable&nbsp;e)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"-----AfterThrowing\u65b9\u6cd5\u5f00\u59cb\u6267\u884c:\"<\/span>+e);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/@Around\u6ce8\u89e3\u53ef\u4ee5\u7528\u6765\u5728\u8c03\u7528\u4e00\u4e2a\u5177\u4f53\u65b9\u6cd5\u524d\u548c\u8c03\u7528\u540e\u6765\u5b8c\u6210\u4e00\u4e9b\u5177\u4f53\u7684\u4efb\u52a1\u3002<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u91cc\u7684\u8fd4\u56de\u503c\u7b49\u4e8e\u65b9\u6cd5\u7684\u8fd4\u56de\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Around<\/span>(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aspect()\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;Object&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">Around<\/span><span style=\"line-height: 26px;\">(ProceedingJoinPoint&nbsp;joinPoint)<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">throws<\/span>&nbsp;Throwable&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u65b9\u6cd5\u5f00\u59cb\u6267\u884c\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Signature&nbsp;signature&nbsp;=&nbsp;joinPoint.getSignature();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u6ce8\u89e3\u7ed1\u5b9a\u7684\u65b9\u6cd5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method&nbsp;method&nbsp;=&nbsp;((MethodSignature)signature).getMethod();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log3&nbsp;annotation&nbsp;=&nbsp;AnnotationUtils.getAnnotation(method,&nbsp;Log3<span style=\"line-height: 26px;\">.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>)<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"aop&nbsp;log3&nbsp;---&gt;\"<\/span>&nbsp;+&nbsp;annotation.hello());<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u5165\u53c2<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object[]&nbsp;inputArgs&nbsp;=&nbsp;joinPoint.getArgs();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u83b7\u53d6\u53c2\u6570\u540d<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String[]&nbsp;argNames&nbsp;=&nbsp;((MethodSignature)&nbsp;signature).getParameterNames();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;paramMap&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;HashMap&lt;&gt;();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">for<\/span>(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;i&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>;&nbsp;i&nbsp;&lt;&nbsp;argNames.length;&nbsp;i++)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;paramMap.put(argNames[i],&nbsp;inputArgs[i]);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u5165\u53c2\"<\/span>&nbsp;+&nbsp;paramMap.toString());<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u4fee\u6539\u5165\u53c2<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inputArgs[<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>]&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"spring&nbsp;aop&nbsp;args\"<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6267\u884c\u65b9\u6cd5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;result&nbsp;=&nbsp;joinPoint.proceed(inputArgs);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u53cd\u5c04\u7ed3\u679c-----&gt;\"<\/span>+&nbsp;result);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd4\u56de\u7ed3\u679c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;result;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u53ef\u4ee5\u770b\u51fa\uff0c\u4ee3\u7801\u4e2d\u5e76\u6ca1\u6709\u6307\u5411\u5177\u4f53\u7684\u7c7b\uff0c\u800c\u662f\u4ee5\u6ce8\u89e3<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">Log3<\/code>\u4e3a\u5207\u70b9\u505a\u4e86\u4e00\u4e9b\u5217\u5904\u7406\uff0c\u5f53\u8fd9\u4e2a\u6ce8\u89e3\u4f5c\u7528\u5230\u76ee\u6807\u7c7b\u4e0a\uff0c\u5c31\u4f1a\u81ea\u52a8\u505a\u5904\u7406\uff0c\u5b66\u4f1a\u4e4b\u540e\u7ed9\u81ea\u5df1\u7684\u8bf7\u6c42\u505a\u4e00\u4e2a\u65e5\u5fd7\u4e0a\u62a5\u529f\u80fd\u8bd5\u8bd5\u5427~<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5230\u8fd9\u91cc\uff0c\u672c\u7ae0\u5df2\u5b8c\u7ed3\uff0c\u4e0b\u671f\u7ed9\u5927\u5bb6\u8bb2\u4e00\u4e0b&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u679a\u4e3e\u548c\u6cdb\u578b<\/span>\u300d<\/strong>\uff0c<span style=\"color: rgb(145, 109, 213);\"><strong>\u300c\u7ed9\u4e2a\u5173\u6ce8\u5457~\u300d<\/strong><\/span><\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">blog\u5730\u5740&nbsp;\u83b7\u53d6\u66f4\u591a\u5185\u5bb9~<\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"440\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042627493.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"440\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042627493.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u70b9\u8d5e<\/figcaption><\/figure>\n<p><\/readmore><\/section>\n<p><br  \/><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u7a0b\u5e8f\u5458\u76ae\u5361\u79cb              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>Java\u6ce8\u89e3\u4e0e\u53cd\u5c04 \u524d\u8a00 \u672c\u7ae0\u8282\u4e3b\u5c5e\u4e8eJava\u8fdb\u9636\u90e8\u5206,\u5982\u679c\u4f60\u521a\u63a5\u89e6Java\u6216\u8005\u5b8c\u5168\u6ca1\u6709\u7f16\u7a0b\u57fa\u7840\uff0c\u4e0d\u5efa\u8bae\u9605\u8bfb\u8fd9\u90e8\u5206\u5185\u5bb9\uff0c\u53ef\u4ee5\u8fd4\u56de\u4e0a &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1387,"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-1395","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\/20230528042618476-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042618476-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042618476.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042618476-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042618476.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042618476.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042619466.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042620671.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042620671.jpeg","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042622270.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042622270.jpeg","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042623334.jpeg","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042623334.jpeg","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042624819.jpeg","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042624819.jpeg","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042625936.jpeg","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042625936.jpeg","id":"image11"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042627493.jpeg","id":"image12"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042627493.jpeg","id":"image13"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2022-01-28","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":256,"next_post_id":81,"next_post_title":"Java\u722c\u53d6\u5e76\u81ea\u5b9a\u4e49\u89e3\u6790\u6570\u636e","previous_post_id":null,"previous_post_title":null,"_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1395","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=1395"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1395\/revisions"}],"predecessor-version":[{"id":3752,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1395\/revisions\/3752"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1387"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}