{"id":1241,"date":"2023-05-28T04:10:16","date_gmt":"2023-05-27T20:10:16","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1241"},"modified":"2023-05-28T04:10:16","modified_gmt":"2023-05-27T20:10:16","slug":"%e3%80%90spring%e6%89%a9%e5%b1%95%e7%82%b9%e3%80%91-%e8%87%aa%e5%ae%9a%e4%b9%89-bean-%e6%b3%a8%e5%86%8c%e6%89%a9%e5%b1%95%e6%9c%ba%e5%88%b6-beandefinitionregistrypostprocessor","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring\/%e3%80%90spring%e6%89%a9%e5%b1%95%e7%82%b9%e3%80%91-%e8%87%aa%e5%ae%9a%e4%b9%89-bean-%e6%b3%a8%e5%86%8c%e6%89%a9%e5%b1%95%e6%9c%ba%e5%88%b6-beandefinitionregistrypostprocessor\/","title":{"rendered":"\u3010Spring\u6269\u5c55\u70b9\u3011 \u81ea\u5b9a\u4e49 bean \u6ce8\u518c\u6269\u5c55\u673a\u5236 BeanDefinitionRegistryPostProcessor"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;padding-right: 10px;padding-left: 10px;line-height: 1.6;letter-spacing: 0px;word-break: break-word;overflow-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\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=\"0.3333333333333333\"  data-type=\"jpeg\" data-w=\"960\" style=\"display: block;margin-right: auto;margin-left: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.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.3333333333333333\"  data-type=\"jpeg\" data-w=\"960\" style=\"display: block;margin-right: auto;margin-left: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.jpeg\"  \/><\/noscript><\/figure>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;font-size: 0.9em;overflow: auto;color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;border-left-color: rgb(239, 112, 96);background: rgb(255, 249, 249);\">\n<p style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;color: black;line-height: 26px;\">\u3010\u6269\u5c55\u70b9\u3011 \u81ea\u5b9a\u4e49 bean \u6ce8\u518c\u6269\u5c55\u673a\u5236 BeanDefinitionRegistryPostProcessor<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u63a5\u7740\u4e0a\u4e00\u7bc7\u5bb9\u5668\u5237\u65b0\u524d\u7684\u6269\u5c55\u70b9\uff0c\u6211\u4eec\u7ee7\u7eed\u5f80\u4e0b\u8d70\uff1b\u63a5\u4e0b\u6765\u6765\u5230\u7684\u5c31\u662f bean \u7684\u5b9a\u4e49\u6269\u5c55\u5904\uff0c\u5b83\u662f\u5728 Spring \u5bb9\u5668\u5237\u65b0\u4e4b\u540e\uff0c\u5e94\u7528\u7684 bean \u5b9a\u4e49\u52a0\u8f7d\u5b8c\u6210\u3001\u5b9e\u4f8b\u5316\u4e4b\u524d\u63d0\u4f9b\u7684\u5207\u5165\u70b9\uff0c\u4e3b\u8981\u662f\u901a\u8fc7\u5b9e\u73b0<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinitionRegistryPostProcessor<\/code>\u63a5\u53e3\u7684\u4e24\u4e2a\u65b9\u6cd5\uff0c\u6765\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684 bean \u5b9a\u4e49\uff0c\u6216\u8005\u5bf9\u5df2\u6ce8\u518c\u7684 bean \u8fdb\u884c\u4fee\u6539 or \u4ee3\u7406\u66ff\u6362<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u672c\u6587\u5c06\u5e26\u6765\u7684\u77e5\u8bc6\u70b9\u5982\u4e0b\uff1a<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">BeanDefinitionRegistryPostProcessor\uff1a\u57fa\u672c\u4f7f\u7528\u59ff\u52bf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanDefinitionRegistry<\/code> \u65b9\u6cd5 \u4f18\u5148\u4e8e <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanFactory<\/code> \u65b9\u6cd5\u6267\u884c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684 bean \u6ce8\u518c\uff0c\u5b9e\u73b0\u5bf9\u5bb9\u5668\u7684 bean \u5b9a\u4e49\u8fdb\u884c\u4fee\u6539<\/section>\n<\/li>\n<\/ul>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">I. \u9879\u76ee\u51c6\u5907<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u672c\u6587\u521b\u5efa\u7684\u5b9e\u4f8b\u5de5\u7a0b\u91c7\u7528<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">SpringBoot 2.2.1.RELEASE<\/code> + <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">maven 3.5.3<\/code> + <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">idea<\/code>\u8fdb\u884c\u5f00\u53d1<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5177\u4f53\u7684 SpringBoot \u9879\u76ee\u5de5\u7a0b\u521b\u5efa\u5c31\u4e0d\u8d58\u8ff0\u4e86\uff0c\u6838\u5fc3\u7684 pom \u6587\u4ef6\uff0c\u65e0\u9700\u989d\u5916\u7684\u4f9d\u8d56\uff1b\u914d\u7f6e\u6587\u4ef6 <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">application.yml<\/code>\uff0c \u4e5f\u6ca1\u6709\u4ec0\u4e48\u7279\u6b8a\u7684\u914d\u7f6e<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>\u8bf4\u660e<\/strong><\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u6e90\u7801\u5de5\u7a0b\u53c2\u8003\u6587\u672b\u7684\u6e90\u7801<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u867d\u7136\u672c\u6587\u662f\u57fa\u4e8e <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">2.2.1.RELEASE<\/code> \u7248\u672c\u8fdb\u884c\u5b9e\u6d4b\uff1b\u5b9e\u9645\u4e0a\u8fd9\u4e9b\u57fa\u7840\u7684\u6269\u5c55\u70b9\uff0c\u5728\u66f4\u9ad8\u7684\u7248\u672c\u4e2d\u8868\u73b0\u4e5f\u4e0d\u4f1a\u6709\u592a\u5927\u7684\u53d8\u52a8\uff0c\u57fa\u672c\u4e0a\u53ef\u4ee5\u65e0\u4fee\u6539\u590d\u73b0<\/section>\n<\/li>\n<\/ul>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">II. \u81ea\u5b9a\u4e49 bean \u6ce8\u518c<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u6709\u5173\u6ce8\u8fc7\u535a\u4e3b\u4e00\u7070\u7070\u7684\u670b\u53cb\uff0c\u5e94\u8be5\u5728\u6211\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\u53ef\u4ee5\u7ffb\u5230 bean \u7684\u52a8\u6001\u6ce8\u518c\u7684\u5185\u5bb9\uff0c\u5176\u4e2d\u5176\u5b9e\u4e5f\u4ecb\u7ecd\u5230\u901a\u8fc7<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinitionRegistryPostProcessor<\/code>\u6765\u5b9e\u73b0 bean \u7684\u52a8\u6001\u6ce8\u518c\uff0c\u6709\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u53ef\u4ee5\u7ffb\u4e00\u4e0b\uff0c\u94fe\u63a5\u5982\u4e0b<\/p>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;font-size: 0.9em;overflow: auto;color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;border-left-color: rgb(239, 112, 96);background: rgb(255, 249, 249);\">\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u3010\u57fa\u7840\u7cfb\u5217\u3011Bean \u4e4b\u52a8\u6001\u6ce8\u518c | \u4e00\u7070\u7070 Blog<\/section>\n<\/li>\n<\/ul>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u63a5\u4e0b\u6765\u6211\u4eec\u5f00\u59cb\u8fdb\u5165\u6b63\u9898<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">1. \u81ea\u5b9a\u4e49 bean \u6ce8\u518c<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u73b0\u5728\u6211\u4eec\u5b9a\u4e49\u4e00\u4e2a\u666e\u901a\u7684 bean \u5bf9\u8c61\uff0c\u4e5f\u5b9a\u4e49\u4e86\u51e0\u4e2a\u5e38\u89c1\u7684 bean \u521d\u59cb\u5316\u4e4b\u540e\u7684\u56de\u8c03\u65b9\u6cd5\uff0c\u987a\u5e26\u9a8c\u8bc1\u4e24\u4e2a\u77e5\u8bc6\u70b9<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u81ea\u5b9a\u4e49\u6ce8\u518c\u7684 bean \u662f\u5426\u8868\u73b0\u548c\u666e\u901a\u7684 bean \u4e00\u81f4<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u521d\u59cb\u5316\u540e\u7684\u65b9\u6cd5\u6267\u884c\u7684\u987a\u5e8f<\/section>\n<\/li>\n<\/ul>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">DemoBean<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">InitializingBean<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">int<\/span>&nbsp;initCode;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">DemoBean<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;initCode&nbsp;=&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;Random().nextInt(<span style=\"color: #008080;line-height: 26px;\">100<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"demo&nbsp;bean&nbsp;create!&nbsp;-&gt;&nbsp;\"<\/span>&nbsp;+&nbsp;initCode);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@PostConstruct<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">init<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"PostConstruct\"<\/span>&nbsp;+&nbsp;initCode);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">afterPropertiesSet<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;Exception&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"afterPropertiesSet\"<\/span>&nbsp;+&nbsp;initCode);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">int<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">getInitCode<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;initCode;<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;\">\u518d\u5b9a\u4e49\u4e00\u4e2a bean\uff0c\u6784\u9020\u65b9\u6cd5\u4f9d\u8d56\u5176\u4ed6\u7684 bean<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">DemoBeanWrapper<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">DemoBean<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;DemoBean&nbsp;demoBean;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">DemoBeanWrapper<\/span><span style=\"line-height: 26px;\">(DemoBean&nbsp;demoBean)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">super<\/span>();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">this<\/span>.demoBean&nbsp;=&nbsp;demoBean;<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;\">\u63a5\u4e0b\u6765\u6211\u4eec\u518d\u770b\u4e00\u4e0b\u8fd9\u4e24\u4e2a bean \u5982\u4f55\u8fdb\u884c\u6ce8\u518c<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Configuration<\/span><br  \/><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">AutoBeanDefinitionRegistryPostProcessor<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">BeanDefinitionRegistryPostProcessor<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">postProcessBeanDefinitionRegistry<\/span><span style=\"line-height: 26px;\">(BeanDefinitionRegistry&nbsp;beanDefinitionRegistry)<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;BeansException&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"========&gt;&nbsp;postProcessBeanDefinitionRegistry&nbsp;---&gt;\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u4e2a\u63a5\u53e3\u4e3b\u8981\u662f\u5728\u8bfb\u53d6\u9879\u76ee\u4e2d\u7684&nbsp;beanDefinition&nbsp;\u4e4b\u540e\u6267\u884c\uff0c\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u9879\u76ee\u672c\u8eab\u7684bean\u5b9a\u4e49\u8bfb\u53d6\u5b8c\u6bd5\u4e4b\u540e\uff0c\u5982\u679c\u6211\u4eec\u8fd8\u60f3\u8865\u5145\u4e00\u4e9b\u81ea\u5b9a\u4e49\u7684bean\u6ce8\u518c\u4fe1\u606f\uff0c\u5219\u53ef\u4ee5\u7528\u5b83<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6ce8\u610f\u4e24\u4e2a\u6838\u5fc3\u70b9\uff1aSpring\u4e0a\u4e0b\u6587\u7684\u6ce8\u518cBean\u5b9a\u4e49\u7684\u903b\u8f91\u90fd\u8dd1\u5b8c\u540e\uff0c\u4f46\u662f\u6240\u6709\u7684Bean\u90fd\u8fd8\u6ca1\u771f\u6b63\u5b9e\u4f8b\u5316\u4e4b\u524d<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6784\u5efabean\u7684\u5b9a\u4e49<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinitionBuilder&nbsp;beanDefinitionBuilder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(DemoBean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>,&nbsp;()&nbsp;-&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u5b9a\u4e49\u8fd9\u4e2abean\u7684\u5b9e\u4f8b\u521b\u5efa\u65b9\u5f0f\uff0c\u5982\u6784\u9020\u51fd\u6570\u4e4b\u540e\u8fd8\u60f3\u8c03\u7528\u5176\u4ed6\u7684\u65b9\u6cd5\uff0c\u4e5f\u53ef\u4ee5\u5728\u8fd9\u91cc\u505a<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DemoBean&nbsp;demoBean&nbsp;=&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;DemoBean();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;demoBean;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;beanDefinitionBuilder.getRawBeanDefinition();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/\u6ce8\u518cbean\u5b9a\u4e49<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beanDefinitionRegistry.registerBeanDefinition(<span style=\"color: #d14;line-height: 26px;\">\"demoBean\"<\/span>,&nbsp;beanDefinition);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">postProcessBeanFactory<\/span><span style=\"line-height: 26px;\">(ConfigurableListableBeanFactory&nbsp;configurableListableBeanFactory)<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;BeansException&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"========&gt;&nbsp;postProcessBeanFactory&nbsp;---&gt;\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u4e2a\u65b9\u6cd5\u8c03\u7528\u65f6\u518d\u4e0a\u9762\u7684\u65b9\u6cd5\u6267\u884c\u4e4b\u540e\uff0c\u5982\u52a0\u8f7d\u81ea\u5b9a\u4e49\u7684bean\u6ce8\u518c\u4f9d\u8d56\u6709\u5176\u4ed6\u7684bean\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u6267\u884c\u8fd9\u4e2a\u65b9\u6cd5<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinitionBuilder&nbsp;builder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(DemoBeanWrapper<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>,&nbsp;()&nbsp;-&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DemoBeanWrapper&nbsp;autoFacDIBean&nbsp;=&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;DemoBeanWrapper(configurableListableBeanFactory.getBean(<span style=\"color: #d14;line-height: 26px;\">\"demoBean\"<\/span>,&nbsp;DemoBean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>))<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;autoFacDIBean;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;builder.getRawBeanDefinition();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((DefaultListableBeanFactory)&nbsp;configurableListableBeanFactory).registerBeanDefinition(<span style=\"color: #d14;line-height: 26px;\">\"demoBeanWrapper\"<\/span>,&nbsp;beanDefinition);<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;\">bean \u7684\u6ce8\u518c\u4ece\u4e0a\u9762\u7684\u4ee3\u7801\u6765\u770b\u6bd4\u8f83\u7b80\u5355\uff0c\u5148\u770b DemoBean \u7684\u6ce8\u518c<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>\u65b9\u6cd5\uff1a<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanDefinitionRegistry<\/code><\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d\u8fdb\u884c\u7b80\u5355\u7684 bean \u6ce8\u518c\uff0c\u9664\u4e86\u4e0a\u9762\u8fd9\u4e2a\u7a0d\u663e\u590d\u6742\u7684\u6ce8\u518c\u65b9\u5f0f\u4e4b\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u66f4\u7b80\u5355\u7684\u7b56\u7565\uff0c\u5982\u4e0b\uff0c\u7701\u7565\u6389<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinitionBuilder.genericBeanDefinition<\/code>\u7b2c\u4e8c\u4e2a\u53c2\u6570<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">BeanDefinitionBuilder&nbsp;beanDefinitionBuilder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(DemoBean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>)<\/span>;<br  \/>BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;beanDefinitionBuilder.getRawBeanDefinition();<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/\u6ce8\u518cbean\u5b9a\u4e49<\/span><br  \/>beanDefinitionRegistry.registerBeanDefinition(<span style=\"color: #d14;line-height: 26px;\">\"demoBean\"<\/span>,&nbsp;beanDefinition);<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u8fd9\u4e2a\u65b9\u6cd5\u5185\u7684 bean \u6ce8\u518c\uff0c\u66f4\u9002\u7528\u4e8e\u7b80\u5355\u7684 bean \u5bf9\u8c61\u6ce8\u518c\uff0c\u5982\u5f53\u5176\u6784\u9020\u65b9\u6cd5\u4f9d\u8d56\u5176\u4ed6\u7684 bean \u65f6\uff0c\u653e\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d\u597d\u50cf\u6ca1\u8f99\uff0c\u6b64\u65f6\u5219\u653e\u5728\u7b2c\u4e8c\u4e2a\u65b9\u6cd5\u4e2d\u5c31\u66f4\u5408\u9002\u4e86<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>\u65b9\u6cd5\uff1a<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanFactory<\/code><\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u8fd9\u4e2a\u65b9\u6cd5\u7684\u53c2\u6570\u662f BeanFactory\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b83\u83b7\u53d6\u5176\u4ed6\u7684 bean \u5bf9\u8c61\uff0c\u56e0\u6b64\u9002\u7528\u4e8e DemoBeanWrapper \u7684\u6ce8\u518c\u4e86\uff0c\u5f53\u7136\u9664\u4e86\u4e0a\u9762\u7684\u4f7f\u7528\u59ff\u52bf\u4e4b\u5916\uff0c\u4e5f\u53ef\u4ee5\u5982\u4e0b<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">postProcessBeanFactory<\/span><span style=\"line-height: 26px;\">(ConfigurableListableBeanFactory&nbsp;configurableListableBeanFactory)<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;BeansException&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinitionBuilder&nbsp;builder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(DemoBeanWrapper<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;\u7528\u4e0b\u9762\u8fd9\u79cd\u65b9\u5f0f\u6307\u5b9a\u6784\u9020\u65b9\u6cd5\u7684\u4f20\u53c2\u4e5f\u53ef\u4ee5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;builder.addConstructorArgValue(configurableListableBeanFactory.getBean(<span style=\"color: #d14;line-height: 26px;\">\"demoBean\"<\/span>,&nbsp;DemoBean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>))<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;builder.getRawBeanDefinition();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;((DefaultListableBeanFactory)&nbsp;configurableListableBeanFactory).registerBeanDefinition(<span style=\"color: #d14;line-height: 26px;\">\"demoBeanWrapper\"<\/span>,&nbsp;beanDefinition);<br  \/>}<br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">2.bean \u6ce8\u518c\u77e5\u8bc6\u70b9<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5355\u72ec\u770b\u4e0a\u9762\u7684\u4ee3\u7801\u53ef\u80fd\u5bf9\u77e5\u8bc6\u70b9\u7406\u89e3\u4e0d\u591f\u76f4\u89c2\u6e05\u6670\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u8fdb\u884c\u77e5\u8bc6\u70b9\u5f52\u7eb3\u4e00\u4e0b<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>bean \u6ce8\u518c\u65b9\u5f0f<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5982\u4f55\u751f\u6210 Bean \u7684\u5b9a\u4e49 <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinition<\/code> ?<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;1.&nbsp;bean\u5b9a\u4e49\u6784\u9020\u5668<\/span><br  \/>BeanDefinitionBuilder&nbsp;beanDefinitionBuilder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(bean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>,&nbsp;()&nbsp;-&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;bean\u5b9e\u4f8b\u5316&nbsp;\u5b9e\u73b0\u65b9\u5f0f,&nbsp;\u82e5bean\u5b58\u5728\u65e0\u53c2\u6784\u9020\u65b9\u6cd5\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u8fd9\u4e2a\u53c2\u6570<\/span><br  \/>});<br  \/><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;2.&nbsp;bean\u5b9a\u4e49\u83b7\u53d6<\/span><br  \/>BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;beanDefinitionBuilder.getRawBeanDefinition();<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u62ff\u5230\u4e0a\u9762\u7684bean\u5b9a\u4e49\u4e4b\u540e\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u6784\u9020\u65b9\u6cd5\u53c2\u6570\uff0c\u4f5c\u7528\u57df\u7b49<\/span><br  \/><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;3.&nbsp;\u6ce8\u518c<\/span><br  \/>beanDefinitionRegistry.registerBeanDefinition(beanName,&nbsp;beanDefinition);<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>\u4e24\u4e2a\u65b9\u6cd5\u7684\u9009\u62e9<\/strong><\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanDefinitionRegistry<\/code> \u65b9\u6cd5\u6267\u884c\u5148\u4e8e <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanFactory<\/code><\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanDefinitionRegistry<\/code> \u5728 bean \u5b9e\u4f8b\u5316\u4e4b\u524d\u89e6\u53d1\uff0c\u53ef\u7528\u4e8e\u6ce8\u518c\u7b80\u5355\u7684\u81ea\u5b9a\u4e49 bean \u5bf9\u8c61<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">postProcessBeanFactory<\/code>: \u82e5 bean \u7684\u5b9a\u4e49\u4e2d\u9700\u8981\u4f9d\u8d56\u5176\u4ed6\u7684 bean \u5bf9\u8c61\uff0c\u5219\u653e\u5728\u8fd9\u4e2a\u65b9\u6cd5\u5185\u5b9e\u73b0\uff0c\u901a\u8fc7 BeanFactory \u53c2\u6570\u83b7\u53d6\u5176\u4ed6 bean<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">3. bean \u5b9a\u4e49\u6269\u5c55<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u6587\u7ae0\u5f00\u5934\u4ecb\u7ecd\u4e86\u9664\u4e86\u81ea\u5b9a\u4e49 bean \u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u505a\u4e00\u4e9b\u5176\u4ed6\u7684\u64cd\u4f5c\uff0c\u5982\u9488\u5bf9\u73b0\u6709\u7684 bean \u5b9a\u4e49\u8fdb\u884c\u4fee\u6539\uff0c\u4e0b\u9762\u7ed9\u4e00\u4e2a\u57fa\u7840\u7684 demo\uff0c\u9488\u5bf9\u4e00\u4e2a\u5df2\u6709\u7684 bean\uff0c\u8bbe\u7f6e\u5b83\u7684 init \u65b9\u6cd5<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u65b0\u589e\u4e00\u4e2a\u666e\u901a\u7684 bean \u5bf9\u8c61<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Component<\/span><br  \/><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">NormalBean<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">InitializingBean<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Autowired<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;DemoBean&nbsp;demoBean;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Autowired<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;DemoBeanWrapper&nbsp;demoBeanWrapper;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@PostConstruct<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">show<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"NormalBean:&nbsp;postConstruct\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(demoBean.getInitCode());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(demoBeanWrapper.getInitCode());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">init<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"NormalBean:&nbsp;method&nbsp;init\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">afterPropertiesSet<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;Exception&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: #d14;line-height: 26px;\">\"NormalBean:&nbsp;afterPropertiesSet\"<\/span>);<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;\">\u7136\u540e\u6211\u4eec\u901a\u8fc7\u4fee\u6539 bean \u6ce8\u518c\uff0c\u6765\u6307\u5b9a bean \u52a0\u8f7d\u5b8c\u4e4b\u540e\uff0c\u6267\u884c init \u65b9\u6cd5\uff0c\u5728\u524d\u9762\u7684<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">AutoBeanDefinitionRegistryPostProcessor<\/code>\u4e2d\u8fdb\u884c\u6269\u5c55<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">postProcessBeanFactory<\/span><span style=\"line-height: 26px;\">(ConfigurableListableBeanFactory&nbsp;configurableListableBeanFactory)<\/span>&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">throws<\/span>&nbsp;BeansException&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;....<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9488\u5bf9\u5df2\u6709\u7684bean\u5b9a\u4e49\u8fdb\u884c\u8c03\u6574<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">for<\/span>&nbsp;(String&nbsp;beanName&nbsp;:&nbsp;configurableListableBeanFactory.getBeanDefinitionNames())&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeanDefinition&nbsp;definition&nbsp;=&nbsp;configurableListableBeanFactory.getBeanDefinition(beanName);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">if<\/span>&nbsp;(definition.getBeanClassName()&nbsp;==&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">null<\/span>)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">continue<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"font-weight: bold;line-height: 26px;\">if<\/span>&nbsp;(definition.getBeanClassName().equalsIgnoreCase(NormalBean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>.<span style=\"color: #458;font-weight: bold;line-height: 26px;\">getName<\/span>()))&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u624b\u52a8\u6307\u5b9a\u4e00\u4e0b\u521d\u59cb\u5316\u65b9\u6cd5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;definition.setInitMethodName(<span style=\"color: #d14;line-height: 26px;\">\"init\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<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;\">\u7136\u540e\u6211\u4eec\u5c06\u6574\u4e2a\u9879\u76ee\u6267\u884c\u4ee5\u4e0b\uff0c\u770b\u4e0b\u4f1a\u8f93\u51fa\u4e9b\u5565<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">========&gt;&nbsp;postProcessBeanDefinitionRegistry&nbsp;---&gt;<br  \/>========&gt;&nbsp;postProcessBeanFactory&nbsp;---&gt;<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u4e0b\u9762\u662fDemoBean\u7684\u76f8\u5173\u8f93\u51fa<\/span><br  \/>demo&nbsp;bean&nbsp;create!&nbsp;-&gt;&nbsp;58<br  \/>afterPropertiesSet58<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u4e0b\u9762\u662fDemoBeanWrapper\u7684\u76f8\u5173\u8f93\u51fa<\/span><br  \/>demo&nbsp;bean&nbsp;create!&nbsp;-&gt;&nbsp;46<br  \/>PostConstruct46<br  \/>afterPropertiesSet46<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u4e0b\u9762\u662fNormalBean\u7684\u76f8\u5173\u8f93\u51fa<\/span><br  \/>NormalBean:&nbsp;postConstruct<br  \/>58<br  \/>46<br  \/>NormalBean:&nbsp;afterPropertiesSet<br  \/>NormalBean:&nbsp;method&nbsp;init<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u4e5f\u53ef\u4ee5\u770b\u51fa\uff0c\u6211\u4eec\u7684\u51e0\u4e2a\u81ea\u5b9a\u4e49 bean \u90fd\u88ab\u6b63\u5e38\u7684\u52a0\u8f7d\u3001\u6ce8\u5165\uff0c\u4f9d\u8d56\u4f7f\u7528\u4e5f\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\uff1b\u800c\u4e14\u4ece\u65e5\u5fd7\u8f93\u51fa\u8fd8\u53ef\u4ee5\u770b\u51fa bean \u521d\u59cb\u5316\u540e\u7684\u89e6\u53d1\u65b9\u6cd5\uff0c\u4e5f\u6709\u5148\u540e\u987a\u5e8f<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">@PostConstruct<\/code> &gt; <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">InitializingBean#afterPropertiesSet<\/code> &gt; <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">init-method<\/code> (\u8fd9\u4e2a\u53ef\u4ee5\u7406\u89e3\u4e3a xml \u5b9a\u4e49 bean \u4e2d\u7684\u521d\u59cb\u5316\u65b9\u6cd5, @Bean \u6ce8\u89e3\u4e2d\u7684 initMethod)<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">4. \u5c0f\u7ed3<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u6700\u540e\u8fdb\u5165\u5927\u5bb6\u559c\u95fb\u4e50\u89c1\u7684\u77e5\u8bc6\u70b9\u6c47\u603b\u73af\u8282\uff0c\u672c\u6587\u4e2d\u4e3b\u8981\u4ecb\u7ecd\u7684\u662f bean \u5b9a\u4e49\u52a0\u8f7d\u4e4b\u540e\u3001\u5b9e\u4f8b\u5316\u4e4b\u524d\u7684\u6269\u5c55\u70b9<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinitionRegistryPostProcessor<\/code><\/p>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\"><span style=\"display: none;\"><\/span>4.1 \u77e5\u8bc6\u70b9\u4e00\uff1a\u6838\u5fc3\u65b9\u6cd5\u8bf4\u660e<span style=\"display: none;\"><\/span><\/h4>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u901a\u8fc7\u5b83\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684 bean \u6ce8\u518c\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u73b0\u6709\u7684 bean \u5b9a\u4e49\u8fdb\u884c\u6269\u5c55\u4fee\u6539\uff1b\u6709\u4e24\u4e2a\u65b9\u6cd5<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>postProcessBeanDefinitionRegistry<\/strong><\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u6267\u884c\u987a\u5e8f\u5728\u4e0b\u9762\u7684\u65b9\u6cd5\u4e4b\u524d\uff0c\u901a\u5e38\u662f\u5728 bean \u5b9e\u4f8b\u5316\u4e4b\u524d\u88ab\u89e6\u53d1<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u9002\u7528\u4e8e\u901a\u7528\u7684 bean \u6ce8\u518c\u5b9a\u4e49<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>postProcessBeanFactory<\/strong><\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5176\u53c2\u6570\u4e3a BeanFactory\uff0c\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7\u5b83\u83b7\u53d6 Spring \u5bb9\u5668\u4e2d\u7684\u5176\u4ed6 bean \u5bf9\u8c61<\/section>\n<\/li>\n<\/ul>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\"><span style=\"display: none;\"><\/span>4.2 \u77e5\u8bc6\u70b9\u4e8c\uff1abean \u6ce8\u518c<span style=\"display: none;\"><\/span><\/h4>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>bean \u6ce8\u518c\u65b9\u5f0f<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5982\u4f55\u751f\u6210 Bean \u7684\u5b9a\u4e49 <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinition<\/code> ?<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;1.&nbsp;bean\u5b9a\u4e49\u6784\u9020\u5668<\/span><br  \/>BeanDefinitionBuilder&nbsp;beanDefinitionBuilder&nbsp;=&nbsp;BeanDefinitionBuilder.genericBeanDefinition(bean<span style=\"line-height: 26px;\">.<span style=\"font-weight: bold;line-height: 26px;\">class<\/span>,&nbsp;()&nbsp;-&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;bean\u5b9e\u4f8b\u5316&nbsp;\u5b9e\u73b0\u65b9\u5f0f,&nbsp;\u82e5bean\u5b58\u5728\u65e0\u53c2\u6784\u9020\u65b9\u6cd5\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u8fd9\u4e2a\u53c2\u6570<\/span><br  \/>});<br  \/><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;2.&nbsp;bean\u5b9a\u4e49\u83b7\u53d6<\/span><br  \/>BeanDefinition&nbsp;beanDefinition&nbsp;=&nbsp;beanDefinitionBuilder.getRawBeanDefinition();<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u62ff\u5230\u4e0a\u9762\u7684bean\u5b9a\u4e49\u4e4b\u540e\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u6784\u9020\u65b9\u6cd5\u53c2\u6570\uff0c\u4f5c\u7528\u57df\u7b49<\/span><br  \/><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;3.&nbsp;\u6ce8\u518c<\/span><br  \/>beanDefinitionRegistry.registerBeanDefinition(beanName,&nbsp;beanDefinition);<br  \/><\/code><\/pre>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\"><span style=\"display: none;\"><\/span>4.3 \u77e5\u8bc6\u70b9\u4e09\uff1a\u4f7f\u7528\u573a\u666f<span style=\"display: none;\"><\/span><\/h4>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u770b\u5b8c\u672c\u6587\u4e4b\u540e\uff0c\u52e4\u4e8e\u601d\u8003\u7684\u5c0f\u4f19\u4f34\u53ef\u80fd\u5c31\u4f1a\u60f3\uff0c\u8fd9\u4e2a\u4e1c\u897f\u5230\u5e95\u6709\u5565\u7528\uff0c\u6709\u771f\u5b9e\u7684\u5e94\u7528\u573a\u666f\u4e48\uff1f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>\u81ea\u5b9a\u4e49 bean \u6ce8\u518c\u5b9e\u4f8b\u573a\u666f<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u8fd9\u4e2a\u5e94\u7528\u573a\u666f\u5c31\u975e\u5e38\u7684\u5178\u578b\u4e86\uff0c\u7528\u8fc7 mybatis \u7684\u5c0f\u4f19\u4f34\u90fd\u77e5\u9053\uff0c\u6211\u4eec\u4f1a\u5b9a\u4e49\u4e00\u4e2a Mapper \u63a5\u53e3\uff0c\u7528\u4e8e\u4e0e\u5bf9\u5e94\u7684 xml \u6587\u4ef6\u8fdb\u884c\u6620\u5c04\uff0c\u90a3\u4e48\u8fd9\u4e9b mapper \u63a5\u53e3\u662f\u600e\u4e48\u6ce8\u518c\u5230 Spring \u5bb9\u5668\u7684\u5462\uff1f<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u6838\u5fc3\u5b9e\u73b0 <code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">org.mybatis.spring.mapper.MapperScannerConfigurer<\/code><\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u501f\u52a9<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanDefinitionRegistryPostProcessor<\/code>\u4e0e<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">ClassPathBeanDefinitionScanner<\/code>\u6765\u5b9e\u73b0\u626b\u63cf\u76f8\u5173\u7684\u7c7b\uff0c\u5e76\u6ce8\u518c bean<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\"><strong>bean \u5b9a\u4e49\u4fee\u6539\u5b9e\u4f8b\u573a\u666f<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5bf9\u4e8e\u5df2\u6709\u7684 bean \u5b9a\u4e49\u8fdb\u884c\u4fee\u6539\uff0c\u540c\u6837\u4e5f\u6709\u4e00\u4e2a\u5e94\u7528\u573a\u666f\uff0c\u5728 SpringCloud \u4e2d\uff0c\u6709\u4e2a<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">RefreshAutoConfiguration#RefreshScopeBeanDefinitionEnhancer<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5b83\u4f1a\u635e\u51fa<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">HikariDataSource<\/code>\u6570\u636e\u6e90 bean \u5bf9\u8c61\uff0c\u6dfb\u52a0<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">RefreshScope<\/code>\u7684\u80fd\u529b\u589e\u5f3a\uff0c\u652f\u6301\u914d\u7f6e\u6587\u4ef6\u7684\u52a8\u6001\u52a0\u8f7d<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u6e90\u914d\u7f6e\u7684\u70ed\u52a0\u8f7d\u66f4\u65b0\uff08\u4e0d\u53d1\u7248\uff0c\u76f4\u63a5\u6539\u6570\u636e\u5e93\u8fde\u63a5\u6c60\uff0c\u662f\u4e0d\u662f\u5f88\u65b9\u4fbf\uff1f\uff09<\/p>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\"><span style=\"display: none;\"><\/span>4.4 \u77e5\u8bc6\u70b9\u56db\uff1abean \u521d\u59cb\u5316\u540e\u6267\u884c\u65b9\u6cd5\u5148\u540e\u987a\u5e8f<span style=\"display: none;\"><\/span><\/h4>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u6211\u4eec\u77e5\u9053\u5728 bean \u521b\u5efa\u4e4b\u540e\u6267\u884c\u67d0\u4e9b\u65b9\u6cd5\u6709\u591a\u79cd\u7b56\u7565\uff0c\u90a3\u4e48\u4e0d\u540c\u7684\u65b9\u5f0f\u5148\u540e\u987a\u5e8f\u662f\u600e\u6837\u7684\u5462\uff1f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">bean \u521b\u5efa\u5230\u9500\u6bc1\u7684\u5148\u540e\u6267\u884c\u987a\u5e8f\u5982\u4e0b<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u6784\u9020\u65b9\u6cd5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">@PostConstruct \u4fee\u9970\u7684\u65b9\u6cd5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">InitializingBean \u63a5\u53e3\u7684\u5b9e\u73b0\u65b9\u6cd5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">xml\/@Bean \u4e2d\u5b9a\u4e49\u7684 initMethod<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">@PreDestroy bean \u9500\u6bc1\u524d\u7684\u6267\u884c\u65b9\u6cd5<\/section>\n<\/li>\n<\/ul>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\"><span style=\"display: none;\"><\/span>\u5176\u4ed6<span style=\"display: none;\"><\/span><\/h4>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u672c\u6587\u4e3a Spring \u6269\u5c55\u70b9\u7cfb\u5217\u4e2d\u7684\u7b2c\u4e8c\u7bc7\uff0c\u63a5\u4e0b\u6765\u7684\u6269\u5c55\u77e5\u8bc6\u70b9\u540c\u6837\u662f bean \u5b9a\u4e49\u4e4b\u540e\uff0c\u5b9e\u4f8b\u5316\u4e4b\u524d\u7684<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">BeanFactoryPostProcessor<\/code>\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u7a76\u7adf\u53c8\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f\u5e94\u7528\u573a\u666f\u53c8\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f\u6211\u662f\u4e00\u7070\u7070\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684 Spring \u4e13\u680f\uff0c\u54b1\u4eec\u4e0b\u6587\u89c1<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4e00\u7070\u7070\u7684 Spring \u4e13\u680f:&nbsp;https:\/\/hhui.top\/spring-extention\/<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\"><a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU3MTAzNTMzMQ==&amp;mid=2247487589&amp;idx=1&amp;sn=2e163a07c2f2e77eeec2d90795cd10db&amp;chksm=fce70bc9cb9082df34b57667c0983004049db8969053debeeaf116140e30711043b4c0884079&amp;token=1437004754&amp;lang=zh_CN&amp;scene=21#wechat_redirect\" style=\"overflow-wrap: break-word;font-weight: bold;color: rgb(239, 112, 96);border-bottom: 1px solid rgb(239, 112, 96);\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u3010Spring \u6269\u5c55\u70b9\u3011 \u5bb9\u5668\u5237\u65b0\u524d\u56de\u8c03 ApplicationContextInitializer<\/a><\/section>\n<\/li>\n<\/ul>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">III. \u4e0d\u80fd\u9519\u8fc7\u7684\u6e90\u7801\u548c\u76f8\u5173\u77e5\u8bc6\u70b9<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">0. \u9879\u76ee<\/span><span style=\"display: none;\"><\/span><\/h3>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u5de5\u7a0b\uff1ahttps:\/\/github.com\/liuyueyi\/spring-boot-demo<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u6e90\u7801\uff1ahttps:\/\/github.com\/liuyueyi\/spring-boot-demo\/tree\/master\/spring-extention\/101-bean-definition<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">1. \u5fae\u4fe1\u516c\u4f17\u53f7: \u4e00\u7070\u7070 Blog<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u5c3d\u4fe1\u4e66\u5219\u4e0d\u5982\uff0c\u4ee5\u4e0a\u5185\u5bb9\uff0c\u7eaf\u5c5e\u4e00\u5bb6\u4e4b\u8a00\uff0c\u56e0\u4e2a\u4eba\u80fd\u529b\u6709\u9650\uff0c\u96be\u514d\u6709\u758f\u6f0f\u548c\u9519\u8bef\u4e4b\u5904\uff0c\u5982\u53d1\u73b0 bug \u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\uff0c\u6b22\u8fce\u6279\u8bc4\u6307\u6b63\uff0c\u4e0d\u541d\u611f\u6fc0<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;\">\u4e0b\u9762\u4e00\u7070\u7070\u7684\u4e2a\u4eba\u535a\u5ba2\uff0c\u8bb0\u5f55\u6240\u6709\u5b66\u4e60\u548c\u5de5\u4f5c\u4e2d\u7684\u535a\u6587\uff0c\u6b22\u8fce\u5927\u5bb6\u524d\u53bb\u901b\u901b<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4e00\u7070\u7070 Blog \u4e2a\u4eba\u535a\u5ba2 https:\/\/blog.hhui.top<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);\">\u4e00\u7070\u7070 Blog-Spring \u4e13\u9898\u535a\u5ba2 http:\/\/spring.hhui.top<\/section>\n<\/li>\n<\/ul>\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=\"0.4265791632485644\"  data-type=\"jpeg\" data-w=\"1219\" style=\"display: block;margin-right: auto;margin-left: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040646485.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.4265791632485644\"  data-type=\"jpeg\" data-w=\"1219\" style=\"display: block;margin-right: auto;margin-left: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040646485.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: #888;font-size: 14px;\">\u4e00\u7070\u7070blog<\/figcaption><\/figure>\n<\/section>\n<p><br  \/><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u4e00\u7070\u7070blog              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u3010\u6269\u5c55\u70b9\u3011 \u81ea\u5b9a\u4e49 bean \u6ce8\u518c\u6269\u5c55\u673a\u5236 BeanDefinitionRegistryPostProcessor \u63a5\u7740\u4e0a\u4e00\u7bc7\u5bb9\u5668 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1238,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[6,19],"tags":[],"class_list":["post-1241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring","category-19"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747-300x127.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747-300x127.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040643747.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040645193.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040646485.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040646485.jpeg","id":"image3"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring","post_date":"2023-05-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":267,"next_post_id":1974,"next_post_title":"Spring IoC\u901a\u4fd7\u7684\u89e3\u91ca","previous_post_id":1153,"previous_post_title":"\u5229\u7528Spring\u6269\u5c55\u70b9\u6a21\u62dfFeign\u5b9e\u73b0\u8fdc\u7a0b\u8c03\u7528","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1241","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=1241"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1241\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1238"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}