{"id":2985,"date":"2023-07-14T17:58:00","date_gmt":"2023-07-14T09:58:00","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=2985"},"modified":"2023-07-14T17:58:00","modified_gmt":"2023-07-14T09:58:00","slug":"%e9%9d%a2%e8%af%95%e5%ae%98%e9%97%ae%ef%bc%9aspringboot%e4%b8%ad%e6%9d%a1%e4%bb%b6%e6%b3%a8%e8%a7%a3%e5%ba%95%e5%b1%82%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/%e9%9d%a2%e8%af%95%e5%ae%98%e9%97%ae%ef%bc%9aspringboot%e4%b8%ad%e6%9d%a1%e4%bb%b6%e6%b3%a8%e8%a7%a3%e5%ba%95%e5%b1%82%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f\/","title":{"rendered":"\u9762\u8bd5\u5b98\u95ee\uff1aSpringBoot\u4e2d\u6761\u4ef6\u6ce8\u89e3\u5e95\u5c42\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"<section style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal; background-color: #ffffff; text-align: left;\" data-mpa-powered-by=\"yiban.io\"><span style=\"font-size: 16px;\">SpringBoot\u5185\u90e8\u63d0\u4f9b\u4e86\u7279\u6709\u7684\u6ce8\u89e3\uff1a\u6761\u4ef6\u6ce8\u89e3<span style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; background-color: #ffffff;\">\uff08<\/span>Conditional Annotation<span style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; background-color: #ffffff;\">\uff09<\/span>\u3002\u6bd4<\/span><span style=\"color: rgb(0 0 0); font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 16px;\">\u5982<\/span><\/section>\n<p style=\"text-align: left;\"><span style=\"font-size: 16px; color: rgb(0 0 0);\">@ConditionalOnBean\u3001<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-size: 16px; color: rgb(0 0 0);\">@ConditionalOnClass\u3001<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"color: rgb(0 0 0); font-size: 16px;\">@ConditionalOnExpression\u3001<\/span><\/p>\n<p style=\"margin-bottom: 20px; text-align: left;\"><span style=\"font-size: 16px; color: rgb(0 0 0);\">@ConditionalOnMissingBean\u7b49\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u6761\u4ef6\u6ce8\u89e3\u5b58\u5728\u7684\u610f\u4e49\u5728\u4e8e\u52a8\u6001\u8bc6\u522b\uff08\u4e5f\u53ef\u4ee5\u8bf4\u662f\u4ee3\u7801\u81ea\u52a8\u5316\u6267\u884c<span style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; background-color: #ffffff;\">\uff09<\/span>\u3002\u6bd4\u5982@ConditionalOnClass\u4f1a\u68c0\u67e5\u7c7b\u52a0\u8f7d\u5668\u4e2d\u662f\u5426\u5b58\u5728\u5bf9\u5e94\u7684\u7c7b\uff0c\u5982\u679c\u6709\u7684\u8bdd\u88ab\u6ce8\u89e3\u4fee\u9970\u7684\u7c7b\u5c31\u6709\u8d44\u683c\u88abSpring\u5bb9\u5668\u6240\u6ce8\u518c\uff0c\u5426\u5219\u4f1a\u88abskip\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u6bd4\u5982FreemarkerAutoConfiguration\u8fd9\u4e2a\u81ea\u52a8\u5316\u914d\u7f6e\u7c7b\u7684\u5b9a\u4e49\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px; color: #8959a8;\">@Configuration<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@ConditionalOnClass<\/span>({ freemarker.template.Configuration.class,<\/span>\n<span style=\"height: 20px;\">\t\tFreeMarkerConfigurationFactory.class })<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@AutoConfigureAfter<\/span>(WebMvcAutoConfiguration.class)<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@EnableConfigurationProperties<\/span>(FreeMarkerProperties.class)<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">class<\/span> <span style=\"color: #3e999f;\">FreeMarkerAutoConfiguration<\/span><\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u8fd9\u4e2a\u81ea\u52a8\u5316\u914d\u7f6e\u7c7b\u88ab@ConditionalOnClass\u6761\u4ef6\u6ce8\u89e3\u4fee\u9970\uff0c\u8fd9\u4e2a\u6761\u4ef6\u6ce8\u89e3\u5b58\u5728\u7684\u610f\u4e49\u5728\u4e8e\u5224\u65ad\u7c7b\u52a0\u8f7d\u5668\u4e2d\u662f\u5426\u5b58\u5728freemarker.template.Configuration\u548cFreeMarkerConfigurationFactory\u8fd9\u4e24\u4e2a\u7c7b\uff0c\u5982\u679c\u90fd\u5b58\u5728\u7684\u8bdd\u4f1a\u5728Spring\u5bb9\u5668\u4e2d\u52a0\u8f7d\u8fd9\u4e2aFreeMarkerAutoConfiguration\u914d\u7f6e\u7c7b\uff1b\u5426\u5219\u4e0d\u4f1a\u52a0\u8f7d\u3002<\/span><\/p>\n<h2 style=\"outline: 0px; font-weight: bold; font-size: 22px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; color: #000000; text-align: left; height: 40px; background-color: #fbfbfb; border-bottom: 1px solid #f6f6f6; overflow: hidden; visibility: visible; margin-bottom: 24px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"margin-left: -10px; padding-right: 30px; padding-left: 30px; outline: 0px; display: inline-block; width: auto; height: 40px; background-color: #212122; border-radius: 8px; color: #ffffff; line-height: 40px; font-size: 18px; visibility: visible;\">\u6761\u4ef6\u6ce8\u89e3\u5185\u90e8\u7684\u4e00\u4e9b\u57fa\u7840<\/span><\/h2>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u5728\u5206\u6790\u6761\u4ef6\u6ce8\u89e3\u7684\u5e95\u5c42\u5b9e\u73b0\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e0b\u8fd9\u4e9b\u6761\u4ef6\u6ce8\u89e3\u7684\u5b9a\u4e49\u3002\u4ee5@ConditionalOnClass\u6ce8\u89e3\u4e3a\u4f8b\uff0c\u5b83\u7684\u5b9a\u4e49\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Target<\/span>({ ElementType.TYPE, ElementType.METHOD })<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Retention<\/span>(RetentionPolicy.RUNTIME)<\/span>\n<span style=\"height: 20px; color: #8959a8;\">@Documented<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Conditional<\/span>(OnClassCondition.class)<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">@interface<\/span> ConditionalOnClass {<\/span>\n<span style=\"height: 20px;\">  Class&lt;?&gt;[] value() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u9700\u8981\u5339\u914d\u7684\u7c7b<\/span><\/span>\n<span style=\"height: 20px;\">  String[] name() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u9700\u8981\u5339\u914d\u7684\u7c7b\u540d<\/span><\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u5b83\u67092\u4e2a\u5c5e\u6027\uff0c\u5206\u522b\u662f\u7c7b\u6570\u7ec4\u548c\u5b57\u7b26\u4e32\u6570\u7ec4(\u4f5c\u7528\u4e00\u6837\uff0c\u7c7b\u578b\u4e0d\u4e00\u6837)\uff0c\u800c\u4e14\u88ab@Conditional\u6ce8\u89e3\u6240\u4fee\u9970\uff0c\u8fd9\u4e2a@Conditional\u6ce8\u89e3\u6709\u4e2a\u540d\u4e3avalues\u7684Class&lt;? extends Condition&gt;[]\u7c7b\u578b\u7684\u5c5e\u6027\u3002\u8fd9\u4e2aCondition\u662f\u4e2a\u63a5\u53e3\uff0c\u7528\u4e8e\u5339\u914d\u7ec4\u4ef6\u662f\u5426\u6709\u8d44\u683c\u88ab\u5bb9\u5668\u6ce8\u518c\uff0c\u5b9a\u4e49\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">interface<\/span> <span style=\"color: #3e999f;\">Condition<\/span> {<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ ConditionContext\u5185\u90e8\u4f1a\u5b58\u50a8Spring\u5bb9\u5668\u3001\u5e94\u7528\u7a0b\u5e8f\u73af\u5883\u4fe1\u606f\u3001\u8d44\u6e90\u52a0\u8f7d\u5668\u3001\u7c7b\u52a0\u8f7d\u5668<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">matches<\/span><span style=\"color: #f5871f;\">(ConditionContext context, AnnotatedTypeMetadata metadata)<\/span><\/span>;<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u4e5f\u5c31\u662f\u8bf4@Conditional\u6ce8\u89e3\u5c5e\u6027\u4e2d\u53ef\u4ee5\u6301\u6709\u591a\u4e2aCondition\u63a5\u53e3\u7684\u5b9e\u73b0\u7c7b\uff0c\u6240\u6709\u7684Condition\u63a5\u53e3\u9700\u8981\u5168\u90e8\u5339\u914d\u6210\u529f\u540e\u8fd9\u4e2a@Conditional\u4fee\u9970\u7684\u7ec4\u4ef6\u624d\u6709\u8d44\u683c\u88ab\u6ce8\u518c\u3002<\/span><\/p>\n<p style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">Condition\u63a5\u53e3\u6709\u4e2a\u5b50\u63a5\u53e3<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">ConfigurationCondition\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">interface<\/span> <span style=\"color: #3e999f;\">ConfigurationCondition<\/span> <span style=\"color: #8959a8;\">extends<\/span> <span style=\"color: #3e999f;\">Condition<\/span> {<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #4271ae;\">ConfigurationPhase <span style=\"color: #3e999f;\">getConfigurationPhase<\/span><span style=\"color: #f5871f;\">()<\/span><\/span>;<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">static<\/span> <span style=\"color: #8959a8;\">enum<\/span> ConfigurationPhase {<\/span>\n\n<span style=\"height: 20px;\">  \tPARSE_CONFIGURATION,<\/span>\n\n<span style=\"height: 20px;\">  \tREGISTER_BEAN<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u8fd9\u4e2a\u5b50\u63a5\u53e3\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6761\u4ef6\u63a5\u53e3\uff0c\u591a\u4e86\u4e00\u4e2agetConfigurationPhase\u65b9\u6cd5\uff0c\u4e5f\u5c31\u662f\u6761\u4ef6\u6ce8\u89e3\u7684\u751f\u6548\u9636\u6bb5\u3002\u53ea\u6709\u5728ConfigurationPhase\u4e2d\u5b9a\u4e49\u7684\u4e24\u79cd\u9636\u6bb5\u4e0b\u624d\u4f1a\u751f\u6548\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">Condition\u63a5\u53e3\u6709\u4e2a\u5b9e\u73b0\u62bd\u8c61\u7c7bSpringBootCondition\uff0cSpringBoot\u4e2d\u6240\u6709\u6761\u4ef6\u6ce8\u89e3\u5bf9\u5e94\u7684\u6761\u4ef6\u7c7b\u90fd\u7ee7\u627f\u8fd9\u4e2a\u62bd\u8c61\u7c7b\u3002\u5b83\u5b9e\u73b0\u4e86matches\u65b9\u6cd5\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px; color: #8959a8;\">@Override<\/span>\n<span style=\"height: 20px; color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">final<\/span> <span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">matches<\/span><span style=\"color: #f5871f;\">(ConditionContext context,<\/span><\/span>\n<span style=\"height: 20px;\"><span style=\"color: #4271ae;\"><span style=\"color: #f5871f;\">\t\tAnnotatedTypeMetadata metadata)<\/span> <\/span>{<\/span>\n<span style=\"height: 20px;\">  String classOrMethodName = getClassOrMethodName(metadata); <span style=\"color: #8e908c;\">\/\/ \u5f97\u5230\u7c7b\u540d\u6216\u8005\u65b9\u6cd5\u540d(\u6761\u4ef6\u6ce8\u89e3\u53ef\u4ee5\u4f5c\u7528\u7684\u7c7b\u6216\u8005\u65b9\u6cd5\u4e0a)<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">try<\/span> {<\/span>\n<span style=\"height: 20px;\">  \tConditionOutcome outcome = getMatchOutcome(context, metadata); <span style=\"color: #8e908c;\">\/\/ \u62bd\u8c61\u65b9\u6cd5\uff0c\u5177\u4f53\u5b50\u7c7b\u5b9e\u73b0\u3002ConditionOutcome\u8bb0\u5f55\u4e86\u5339\u914d\u7ed3\u679cboolean\u548clog\u4fe1\u606f<\/span><\/span>\n<span style=\"height: 20px;\">  \tlogOutcome(classOrMethodName, outcome); <span style=\"color: #8e908c;\">\/\/ log\u8bb0\u5f55\u4e00\u4e0b\u5339\u914d\u4fe1\u606f<\/span><\/span>\n<span style=\"height: 20px;\">  \trecordEvaluation(context, classOrMethodName, outcome); <span style=\"color: #8e908c;\">\/\/ \u62a5\u544a\u8bb0\u5f55\u4e00\u4e0b\u5339\u914d\u4fe1\u606f<\/span><\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">return<\/span> outcome.isMatch(); <span style=\"color: #8e908c;\">\/\/ \u8fd4\u56de\u662f\u5426\u5339\u914d<\/span><\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">catch<\/span> (NoClassDefFoundError ex) {<\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">throw<\/span> <span style=\"color: #8959a8;\">new<\/span> IllegalStateException(<\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #718c00;\">\"Could not evaluate condition on \"<\/span> + classOrMethodName + <span style=\"color: #718c00;\">\" due to \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t+ ex.getMessage() + <span style=\"color: #718c00;\">\" not \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t+ <span style=\"color: #718c00;\">\"found. Make sure your own configuration does not rely on \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t+ <span style=\"color: #718c00;\">\"that class. This can also happen if you are \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t+ <span style=\"color: #718c00;\">\"@ComponentScanning a springframework package (e.g. if you \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t+ <span style=\"color: #718c00;\">\"put a @ComponentScan in the default package by mistake)\"<\/span>,<\/span>\n<span style=\"height: 20px;\">  \t\t\tex);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">catch<\/span> (RuntimeException ex) {<\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">throw<\/span> <span style=\"color: #8959a8;\">new<\/span> IllegalStateException(<\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #718c00;\">\"Error processing condition on \"<\/span> + getName(metadata), ex);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 style=\"margin-bottom: 24px; font-weight: bold; font-size: 22px; white-space: normal; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; color: #000000; text-align: left; height: 40px; background-color: #fbfbfb; border-bottom: 1px solid #f6f6f6; overflow: hidden; visibility: visible;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"margin-left: -10px; padding-right: 30px; padding-left: 30px; outline: 0px; display: inline-block; width: auto; height: 40px; background-color: #212122; border-radius: 8px; color: #ffffff; line-height: 40px; font-size: 18px; visibility: visible;\">\u57fa\u4e8eClass\u7684\u6761\u4ef6\u6ce8\u89e3<\/span><\/h2>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">SpringBoot\u63d0\u4f9b\u4e86\u4e24\u4e2a\u57fa\u4e8eClass\u7684\u6761\u4ef6\u6ce8\u89e3\uff1a@ConditionalOnClass(\u7c7b\u52a0\u8f7d\u5668\u4e2d\u5b58\u5728\u6307\u660e\u7684\u7c7b)\u6216\u8005@ConditionalOnMissingClass(\u7c7b\u52a0\u8f7d\u5668\u4e2d\u4e0d\u5b58\u5728\u6307\u660e\u7684\u7c7b)\u3002<\/span><\/p>\n<section style=\"color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; margin-bottom: 5px; text-align: left;\"><span style=\"font-size: 16px;\">@ConditionalOnClass\u6216\u8005<\/span><\/section>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">@ConditionalOnMissingClass\u6ce8\u89e3\u5bf9\u5e94\u7684\u6761\u4ef6\u7c7b\u662fOnClassCondition\uff0c\u5b9a\u4e49\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Order<\/span>(Ordered.HIGHEST_PRECEDENCE) <span style=\"color: #8e908c;\">\/\/ \u4f18\u5148\u7ea7\u3001\u6700\u9ad8\u7ea7\u522b<\/span><\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">class<\/span> <span style=\"color: #3e999f;\">OnClassCondition<\/span> <span style=\"color: #8959a8;\">extends<\/span> <span style=\"color: #3e999f;\">SpringBootCondition<\/span> {<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">@Override<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> ConditionOutcome <span style=\"color: #3e999f;\">getMatchOutcome<\/span><span style=\"color: #f5871f;\">(ConditionContext context,<\/span><\/span><\/span>\n<span style=\"height: 20px;\"><span style=\"color: #4271ae;\"><span style=\"color: #f5871f;\">  \t\tAnnotatedTypeMetadata metadata)<\/span> <\/span>{<\/span>\n\n<span style=\"height: 20px;\">  \tStringBuffer matchMessage = <span style=\"color: #8959a8;\">new<\/span> StringBuffer(); <span style=\"color: #8e908c;\">\/\/ \u8bb0\u5f55\u5339\u914d\u4fe1\u606f<\/span><\/span>\n\n<span style=\"height: 20px;\">  \tMultiValueMap&lt;String, Object&gt; onClasses = getAttributes(metadata,<\/span>\n<span style=\"height: 20px;\">  \t\t\tConditionalOnClass.class); <span style=\"color: #8e908c;\">\/\/ \u5f97\u5230@ConditionalOnClass\u6ce8\u89e3\u7684\u5c5e\u6027<\/span><\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">if<\/span> (onClasses != <span style=\"color: #8959a8;\">null<\/span>) { <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u5c5e\u6027\u5b58\u5728<\/span><\/span>\n<span style=\"height: 20px;\">  \t\tList&lt;String&gt; missing = getMatchingClasses(onClasses, MatchType.MISSING,<\/span>\n<span style=\"height: 20px;\">  \t\t\t\tcontext); <span style=\"color: #8e908c;\">\/\/ \u5f97\u5230\u5728\u7c7b\u52a0\u8f7d\u5668\u4e2d\u4e0d\u5b58\u5728\u7684\u7c7b<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #8959a8;\">if<\/span> (!missing.isEmpty()) { <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u5b58\u5728\u7c7b\u52a0\u8f7d\u5668\u4e2d\u4e0d\u5b58\u5728\u5bf9\u5e94\u7684\u7c7b\uff0c\u8fd4\u56de\u4e00\u4e2a\u5339\u914d\u5931\u8d25\u7684ConditionalOutcome<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #8959a8;\">return<\/span> ConditionOutcome<\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t.noMatch(<span style=\"color: #718c00;\">\"required @ConditionalOnClass classes not found: \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t\t\t+ StringUtils.collectionToCommaDelimitedString(missing));<\/span>\n<span style=\"height: 20px;\">  \t\t}<\/span>\n<span style=\"height: 20px;\">                <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u7c7b\u52a0\u8f7d\u5668\u4e2d\u5b58\u5728\u5bf9\u5e94\u7684\u7c7b\u7684\u8bdd\uff0c\u5339\u914d\u4fe1\u606f\u8fdb\u884c\u8bb0\u5f55<\/span><\/span>\n<span style=\"height: 20px;\">  \t\tmatchMessage.append(<span style=\"color: #718c00;\">\"@ConditionalOnClass classes found: \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t+ StringUtils.collectionToCommaDelimitedString(<\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t\tgetMatchingClasses(onClasses, MatchType.PRESENT, context)));<\/span>\n<span style=\"height: 20px;\">  \t}<\/span>\n<span style=\"height: 20px;\">        <span style=\"color: #8e908c;\">\/\/ \u5bf9@ConditionalOnMissingClass\u6ce8\u89e3\u505a\u76f8\u540c\u7684\u903b\u8f91\u5904\u7406(\u8bf4\u660e@ConditionalOnClass\u548c@ConditionalOnMissingClass\u53ef\u4ee5\u4e00\u8d77\u4f7f\u7528)<\/span><\/span>\n<span style=\"height: 20px;\">  \tMultiValueMap&lt;String, Object&gt; onMissingClasses = getAttributes(metadata,<\/span>\n<span style=\"height: 20px;\">  \t\t\tConditionalOnMissingClass.class);<\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">if<\/span> (onMissingClasses != <span style=\"color: #8959a8;\">null<\/span>) {<\/span>\n<span style=\"height: 20px;\">  \t\tList&lt;String&gt; present = getMatchingClasses(onMissingClasses, MatchType.PRESENT,<\/span>\n<span style=\"height: 20px;\">  \t\t\t\tcontext);<\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #8959a8;\">if<\/span> (!present.isEmpty()) {<\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #8959a8;\">return<\/span> ConditionOutcome<\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t.noMatch(<span style=\"color: #718c00;\">\"required @ConditionalOnMissing classes found: \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t\t\t+ StringUtils.collectionToCommaDelimitedString(present));<\/span>\n<span style=\"height: 20px;\">  \t\t}<\/span>\n<span style=\"height: 20px;\">  \t\tmatchMessage.append(matchMessage.length() == <span style=\"color: #718c00;\">0<\/span> ? <span style=\"color: #718c00;\">\"\"<\/span> : <span style=\"color: #718c00;\">\" \"<\/span>);<\/span>\n<span style=\"height: 20px;\">  \t\tmatchMessage.append(<span style=\"color: #718c00;\">\"@ConditionalOnMissing classes not found: \"<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t\t\t+ StringUtils.collectionToCommaDelimitedString(getMatchingClasses(<\/span>\n<span style=\"height: 20px;\">  \t\t\t\t\t\tonMissingClasses, MatchType.MISSING, context)));<\/span>\n<span style=\"height: 20px;\">  \t}<\/span>\n<span style=\"height: 20px;\">        <span style=\"color: #8e908c;\">\/\/ \u8fd4\u56de\u5168\u90e8\u5339\u914d\u6210\u529f\u7684ConditionalOutcome<\/span><\/span>\n<span style=\"height: 20px;\">  \t<span style=\"color: #8959a8;\">return<\/span> ConditionOutcome.match(matchMessage.toString());<\/span>\n<span style=\"height: 20px;\">\t}<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">private<\/span> <span style=\"color: #8959a8;\">enum<\/span> MatchType { <span style=\"color: #8e908c;\">\/\/ \u679a\u4e3e\uff1a\u5339\u914d\u7c7b\u578b\u3002\u7528\u4e8e\u67e5\u8be2\u7c7b\u540d\u5728\u5bf9\u5e94\u7684\u7c7b\u52a0\u8f7d\u5668\u4e2d\u662f\u5426\u5b58\u5728\u3002<\/span><\/span>\n\n<span style=\"height: 20px;\">  \tPRESENT { <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u6210\u529f<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #8959a8;\">@Override<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">matches<\/span><span style=\"color: #f5871f;\">(String className, ConditionContext context)<\/span> <\/span>{<\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #8959a8;\">return<\/span> ClassUtils.isPresent(className, context.getClassLoader());<\/span>\n<span style=\"height: 20px;\">  \t\t}<\/span>\n<span style=\"height: 20px;\">  \t},<\/span>\n\n<span style=\"height: 20px;\">  \tMISSING { <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u4e0d\u6210\u529f<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #8959a8;\">@Override<\/span><\/span>\n<span style=\"height: 20px;\">  \t\t<span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">matches<\/span><span style=\"color: #f5871f;\">(String className, ConditionContext context)<\/span> <\/span>{<\/span>\n<span style=\"height: 20px;\">  \t\t\t<span style=\"color: #8959a8;\">return<\/span> !ClassUtils.isPresent(className, context.getClassLoader());<\/span>\n<span style=\"height: 20px;\">  \t\t}<\/span>\n<span style=\"height: 20px;\">  \t};<\/span>\n\n<span style=\"height: 20px;\">  \t<span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">abstract<\/span> <span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">matches<\/span><span style=\"color: #f5871f;\">(String className, ConditionContext context)<\/span><\/span>;<\/span>\n\n<span style=\"height: 20px;\">  }<\/span>\n\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u6bd4\u5982FreemarkerAutoConfiguration\u4e2d\u7684@ConditionalOnClass\u6ce8\u89e3\u4e2d\u6709value\u5c5e\u6027\u662ffreemarker.template.Configuration.class\u548cFreeMarkerConfigurationFactory.class\u3002\u5728OnClassCondition\u6267\u884c\u8fc7\u7a0b\u4e2d\u5f97\u5230\u7684\u6700\u7ec8ConditionalOutcome\u4e2d\u7684log message\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@ConditionalOnClass<\/span> classes found: freemarker.template.Configuration,org.springframework.ui.freemarker.FreeMarkerConfigurationFactory<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 style=\"margin-bottom: 24px; font-weight: bold; font-size: 22px; white-space: normal; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; color: #000000; text-align: left; height: 40px; background-color: #fbfbfb; border-bottom: 1px solid #f6f6f6; overflow: hidden; visibility: visible;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"margin-left: -10px; padding-right: 30px; padding-left: 30px; outline: 0px; display: inline-block; width: auto; height: 40px; background-color: #212122; border-radius: 8px; color: #ffffff; line-height: 40px; font-size: 18px; visibility: visible;\">\u57fa\u4e8eBean\u7684\u6761\u4ef6\u6ce8\u89e3<\/span><\/h2>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">@ConditionalOnBean(Spring\u5bb9\u5668\u4e2d\u5b58\u5728\u6307\u660e\u7684bean)\u3001@ConditionalOnMissingBean(Spring\u5bb9\u5668\u4e2d\u4e0d\u5b58\u5728\u6307\u660e\u7684bean)\u4ee5\u53caConditionalOnSingleCandidate(Spring\u5bb9\u5668\u4e2d\u5b58\u5728\u4e14\u53ea\u5b58\u5728\u4e00\u4e2a\u6307\u660e\u7684bean)\u90fd\u662f\u57fa\u4e8eBean\u7684\u6761\u4ef6\u6ce8\u89e3\uff0c\u5b83\u4eec\u5bf9\u5e94\u7684\u6761\u4ef6\u7c7b\u662fConditionOnBean\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">@ConditionOnBean\u6ce8\u89e3\u5b9a\u4e49\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Target<\/span>({ ElementType.TYPE, ElementType.METHOD })<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Retention<\/span>(RetentionPolicy.RUNTIME)<\/span>\n<span style=\"height: 20px; color: #8959a8;\">@Documented<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">@Conditional<\/span>(OnBeanCondition.class)<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">@interface<\/span> ConditionalOnBean {<\/span>\n<span style=\"height: 20px;\">  Class&lt;?&gt;[] value() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u7684bean\u7c7b\u578b<\/span><\/span>\n<span style=\"height: 20px;\">  String[] type() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u7684bean\u7c7b\u578b\u7684\u7c7b\u540d<\/span><\/span>\n<span style=\"height: 20px;\">  Class&lt;? extends Annotation&gt;[] annotation() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u7684bean\u6ce8\u89e3<\/span><\/span>\n<span style=\"height: 20px;\">  String[] name() <span style=\"color: #8959a8;\">default<\/span> {}; <span style=\"color: #8e908c;\">\/\/ \u5339\u914d\u7684bean\u7684\u540d\u5b57<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #4271ae;\">SearchStrategy <span style=\"color: #3e999f;\">search<\/span><span style=\"color: #f5871f;\">()<\/span> <span style=\"color: #8959a8;\">default<\/span> SearchStrategy.ALL<\/span>; <span style=\"color: #8e908c;\">\/\/ \u641c\u7d22\u7b56\u7565\u3002\u63d0\u4f9bCURRENT(\u53ea\u5728\u5f53\u524d\u5bb9\u5668\u4e2d\u627e)\u3001PARENTS(\u53ea\u5728\u6240\u6709\u7684\u7236\u5bb9\u5668\u4e2d\u627e\uff1b\u4f46\u662f\u4e0d\u5305\u62ec\u5f53\u524d\u5bb9\u5668)\u548cALL(CURRENT\u548cPARENTS\u7684\u7ec4\u5408)<\/span><\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">OnBeanCondition\u6761\u4ef6\u7c7b\u7684\u5339\u914d\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px; color: #8959a8;\">@Override<\/span>\n<span style=\"height: 20px; color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> ConditionOutcome <span style=\"color: #3e999f;\">getMatchOutcome<\/span><span style=\"color: #f5871f;\">(ConditionContext context,<\/span><\/span>\n<span style=\"height: 20px;\"><span style=\"color: #4271ae;\"><span style=\"color: #f5871f;\">    AnnotatedTypeMetadata metadata)<\/span> <\/span>{<\/span>\n<span style=\"height: 20px;\">  StringBuffer matchMessage = <span style=\"color: #8959a8;\">new<\/span> StringBuffer(); <span style=\"color: #8e908c;\">\/\/ \u8bb0\u5f55\u5339\u914d\u4fe1\u606f<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">if<\/span> (metadata.isAnnotated(ConditionalOnBean.class.getName())) {<\/span>\n<span style=\"height: 20px;\">    BeanSearchSpec spec = <span style=\"color: #8959a8;\">new<\/span> BeanSearchSpec(context, metadata,<\/span>\n<span style=\"height: 20px;\">        ConditionalOnBean.class); <span style=\"color: #8e908c;\">\/\/ \u6784\u9020\u4e00\u4e2aBeanSearchSpec\uff0c\u4f1a\u4ece@ConditionalOnBean\u6ce8\u89e3\u4e2d\u83b7\u53d6\u5c5e\u6027\uff0c\u7136\u540e\u8bbe\u7f6e\u5230BeanSearchSpec\u4e2d<\/span><\/span>\n<span style=\"height: 20px;\">    List&lt;String&gt; matching = getMatchingBeans(context, spec); <span style=\"color: #8e908c;\">\/\/ \u4eceBeanFactory\u4e2d\u6839\u636e\u7b56\u7565\u627e\u51fa\u6240\u6709\u5339\u914d\u7684bean<\/span><\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (matching.isEmpty()) { <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u6ca1\u6709\u5339\u914d\u7684bean\uff0c\u8fd4\u56de\u4e00\u4e2a\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684ConditionalOutcome<\/span><\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">return<\/span> ConditionOutcome<\/span>\n<span style=\"height: 20px;\">          .noMatch(<span style=\"color: #718c00;\">\"@ConditionalOnBean \"<\/span> + spec + <span style=\"color: #718c00;\">\" found no beans\"<\/span>);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u627e\u5230\u5339\u914d\u7684bean\uff0c\u5339\u914d\u4fe1\u606f\u8fdb\u884c\u8bb0\u5f55<\/span><\/span>\n<span style=\"height: 20px;\">    matchMessage.append(<\/span>\n<span style=\"height: 20px;\">        <span style=\"color: #718c00;\">\"@ConditionalOnBean \"<\/span> + spec + <span style=\"color: #718c00;\">\" found the following \"<\/span> + matching);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">if<\/span> (metadata.isAnnotated(ConditionalOnSingleCandidate.class.getName())) { <span style=\"color: #8e908c;\">\/\/ \u76f8\u540c\u7684\u903b\u8f91\uff0c\u9488\u5bf9@ConditionalOnSingleCandidate\u6ce8\u89e3<\/span><\/span>\n<span style=\"height: 20px;\">    BeanSearchSpec spec = <span style=\"color: #8959a8;\">new<\/span> SingleCandidateBeanSearchSpec(context, metadata,<\/span>\n<span style=\"height: 20px;\">        ConditionalOnSingleCandidate.class);<\/span>\n<span style=\"height: 20px;\">    List&lt;String&gt; matching = getMatchingBeans(context, spec);<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (matching.isEmpty()) {<\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">return<\/span> ConditionOutcome.noMatch(<\/span>\n<span style=\"height: 20px;\">          <span style=\"color: #718c00;\">\"@ConditionalOnSingleCandidate \"<\/span> + spec + <span style=\"color: #718c00;\">\" found no beans\"<\/span>);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">else<\/span> <span style=\"color: #8959a8;\">if<\/span> (!hasSingleAutowireCandidate(context.getBeanFactory(), matching)) { <span style=\"color: #8e908c;\">\/\/ \u591a\u4e86\u4e00\u5c42\u5224\u65ad\uff0c\u5224\u65ad\u662f\u5426\u53ea\u6709\u4e00\u4e2abean<\/span><\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">return<\/span> ConditionOutcome.noMatch(<span style=\"color: #718c00;\">\"@ConditionalOnSingleCandidate \"<\/span> + spec<\/span>\n<span style=\"height: 20px;\">          + <span style=\"color: #718c00;\">\" found no primary candidate amongst the\"<\/span> + <span style=\"color: #718c00;\">\" following \"<\/span><\/span>\n<span style=\"height: 20px;\">          + matching);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    matchMessage.append(<span style=\"color: #718c00;\">\"@ConditionalOnSingleCandidate \"<\/span> + spec + <span style=\"color: #718c00;\">\" found \"<\/span><\/span>\n<span style=\"height: 20px;\">        + <span style=\"color: #718c00;\">\"a primary candidate amongst the following \"<\/span> + matching);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">if<\/span> (metadata.isAnnotated(ConditionalOnMissingBean.class.getName())) { <span style=\"color: #8e908c;\">\/\/ \u76f8\u540c\u7684\u903b\u8f91\uff0c\u9488\u5bf9@ConditionalOnMissingBean\u6ce8\u89e3<\/span><\/span>\n<span style=\"height: 20px;\">    BeanSearchSpec spec = <span style=\"color: #8959a8;\">new<\/span> BeanSearchSpec(context, metadata,<\/span>\n<span style=\"height: 20px;\">        ConditionalOnMissingBean.class);<\/span>\n<span style=\"height: 20px;\">    List&lt;String&gt; matching = getMatchingBeans(context, spec);<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (!matching.isEmpty()) {<\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">return<\/span> ConditionOutcome.noMatch(<span style=\"color: #718c00;\">\"@ConditionalOnMissingBean \"<\/span> + spec<\/span>\n<span style=\"height: 20px;\">          + <span style=\"color: #718c00;\">\" found the following \"<\/span> + matching);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    matchMessage.append(matchMessage.length() == <span style=\"color: #718c00;\">0<\/span> ? <span style=\"color: #718c00;\">\"\"<\/span> : <span style=\"color: #718c00;\">\" \"<\/span>);<\/span>\n<span style=\"height: 20px;\">    matchMessage.append(<span style=\"color: #718c00;\">\"@ConditionalOnMissingBean \"<\/span> + spec + <span style=\"color: #718c00;\">\" found no beans\"<\/span>);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">return<\/span> ConditionOutcome.match(matchMessage.toString()); <span style=\"color: #8e908c;\">\/\/\u8fd4\u56de\u5339\u914d\u6210\u529f\u7684ConditonalOutcome<\/span><\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">SpringBoot\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u6bd4\u5982ConditionalOnJava\u3001ConditionalOnNotWebApplication\u3001ConditionalOnWebApplication\u3001ConditionalOnResource\u3001ConditionalOnProperty\u3001ConditionalOnExpression\u7b49\u6761\u4ef6\u6ce8\u89e3\uff0c\u6709\u5174\u8da3\u7684\u8bfb\u8005\u53ef\u4ee5\u81ea\u884c\u67e5\u770b\u5b83\u4eec\u7684\u5e95\u5c42\u5904\u7406\u903b\u8f91\u3002\u5173\u4e8e\u66f4\u591a\u9762\u8bd5\u8d44\u6599\uff0c\u516c\u4f17\u53f7Java\u7cbe\u9009\uff0c\u56de\u590djava\u9762\u8bd5\uff0c\u83b7\u53d6\u5728\u7ebf\u9762\u8bd5\u8d44\u6599\uff0c\u652f\u6301\u968f\u65f6\u968f\u5730\u5237\u9898\u3002<\/span><\/p>\n<h2 style=\"margin-bottom: 24px; font-weight: bold; font-size: 22px; white-space: normal; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; color: #000000; text-align: left; height: 40px; background-color: #fbfbfb; border-bottom: 1px solid #f6f6f6; overflow: hidden; visibility: visible;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"margin-left: -10px; padding-right: 30px; padding-left: 30px; outline: 0px; display: inline-block; width: auto; height: 40px; background-color: #212122; border-radius: 8px; color: #ffffff; line-height: 40px; font-size: 18px; visibility: visible;\">\u5404\u79cd\u6761\u4ef6\u6ce8\u89e3\u7684\u603b\u7ed3<\/span><\/h2>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"313\" data-backw=\"578\" data-ratio=\"0.5416666666666666\" data-s=\"300,640\" data-type=\"png\" data-w=\"864\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png\" data-backh=\"313\" data-backw=\"578\" data-ratio=\"0.5416666666666666\" data-s=\"300,640\" data-type=\"png\" data-w=\"864\" \/><\/noscript><\/p>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/202307141757212b2bb90ff.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"404\" data-backw=\"578\" data-ratio=\"0.6983758700696056\" data-s=\"300,640\" data-type=\"png\" data-w=\"862\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/202307141757212b2bb90ff.png\" data-backh=\"404\" data-backw=\"578\" data-ratio=\"0.6983758700696056\" data-s=\"300,640\" data-type=\"png\" data-w=\"862\" \/><\/noscript><\/p>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/20230714175722c9c9567a2.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"430\" data-backw=\"578\" data-ratio=\"0.7444831591173054\" data-s=\"300,640\" data-type=\"png\" data-w=\"861\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/20230714175722c9c9567a2.png\" data-backh=\"430\" data-backw=\"578\" data-ratio=\"0.7444831591173054\" data-s=\"300,640\" data-type=\"png\" data-w=\"861\" \/><\/noscript><\/p>\n<section style=\"text-align: left; margin-bottom: 15px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/202307141757222727905cf.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"170\" data-backw=\"578\" data-ratio=\"0.29282407407407407\" data-s=\"300,640\" data-type=\"png\" data-w=\"864\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/202307141757222727905cf.png\" data-backh=\"170\" data-backw=\"578\" data-ratio=\"0.29282407407407407\" data-s=\"300,640\" data-type=\"png\" data-w=\"864\" \/><\/noscript><\/section>\n<p style=\"text-align: left;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723989868990.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"436\" data-backw=\"578\" data-ratio=\"0.7546511627906977\" data-s=\"300,640\" data-type=\"png\" data-w=\"860\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723989868990.png\" data-backh=\"436\" data-backw=\"578\" data-ratio=\"0.7546511627906977\" data-s=\"300,640\" data-type=\"png\" data-w=\"860\" \/><\/noscript><\/p>\n<section style=\"text-align: left; margin-bottom: 5px;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 100%; height: auto;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723c0c0e3e45.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-backh=\"150\" data-backw=\"578\" data-ratio=\"0.2586605080831409\" data-s=\"300,640\" data-type=\"png\" data-w=\"866\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 100%; height: auto;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723c0c0e3e45.png\" data-backh=\"150\" data-backw=\"578\" data-ratio=\"0.2586605080831409\" data-s=\"300,640\" data-type=\"png\" data-w=\"866\" \/><\/noscript><\/section>\n<h2 style=\"margin-bottom: 24px; font-weight: bold; font-size: 22px; white-space: normal; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; color: #000000; text-align: left; height: 40px; background-color: #fbfbfb; border-bottom: 1px solid #f6f6f6; overflow: hidden; visibility: visible; margin-top: 24px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"margin-left: -10px; padding-right: 30px; padding-left: 30px; outline: 0px; display: inline-block; width: auto; height: 40px; background-color: #212122; border-radius: 8px; color: #ffffff; line-height: 40px; font-size: 18px; visibility: visible;\">SpringBoot\u6761\u4ef6\u6ce8\u89e3\u7684\u6fc0\u6d3b\u673a\u5236<\/span><\/h2>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u5206\u6790\u5b8c\u4e86\u6761\u4ef6\u6ce8\u89e3\u7684\u6267\u884c\u903b\u8f91\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u7684\u95ee\u9898\u5c31\u662fSpringBoot\u662f\u5982\u4f55\u8ba9\u8fd9\u4e9b\u6761\u4ef6\u6ce8\u89e3\u751f\u6548\u7684\uff1f<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">SpringBoot\u4f7f\u7528ConditionEvaluator\u8fd9\u4e2a\u5185\u90e8\u7c7b\u5b8c\u6210\u6761\u4ef6\u6ce8\u89e3\u7684\u89e3\u6790\u548c\u5224\u65ad\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u5728Spring\u5bb9\u5668\u7684refresh\u8fc7\u7a0b\u4e2d\uff0c\u53ea\u6709\u8ddf\u89e3\u6790\u6216\u8005\u6ce8\u518cbean\u6709\u5173\u7cfb\u7684\u7c7b\u90fd\u4f1a\u4f7f\u7528ConditionEvaluator\u5b8c\u6210\u6761\u4ef6\u6ce8\u89e3\u7684\u5224\u65ad\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u4e00\u4e9b\u7c7b\u4e0d\u6ee1\u8db3\u6761\u4ef6\u7684\u8bdd\u5c31\u4f1a\u88abskip\u3002\u8fd9\u4e9b\u7c7b\u6bd4\u5982\u6709AnnotatedBeanDefinitionReader\u3001ConfigurationClassBeanDefinitionReader\u3001ConfigurationClassParse\u3001ClassPathScanningCandidateComponentProvider\u7b49\u3002<\/span><\/p>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u6bd4\u5982ConfigurationClassParser\u7684\u6784\u9020\u51fd\u6570\u4f1a\u521d\u59cb\u5316\u5185\u90e8\u5c5e\u6027conditionEvaluator\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px; color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #3e999f;\">ConfigurationClassParser<\/span><span style=\"color: #f5871f;\">(MetadataReaderFactory metadataReaderFactory,<\/span><\/span>\n<span style=\"height: 20px; color: #f5871f;\">    ProblemReporter problemReporter, Environment environment, ResourceLoader resourceLoader,<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #4271ae;\"><span style=\"color: #f5871f;\">    BeanNameGenerator componentScanBeanNameGenerator, BeanDefinitionRegistry registry)<\/span> <\/span>{<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.metadataReaderFactory = metadataReaderFactory;<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.problemReporter = problemReporter;<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.environment = environment;<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.resourceLoader = resourceLoader;<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.registry = registry;<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.componentScanParser = <span style=\"color: #8959a8;\">new<\/span> ComponentScanAnnotationParser(<\/span>\n<span style=\"height: 20px;\">      resourceLoader, environment, componentScanBeanNameGenerator, registry);<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u6784\u9020ConditionEvaluator\u7528\u4e8e\u5904\u7406\u6761\u4ef6\u6ce8\u89e3<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">this<\/span>.conditionEvaluator = <span style=\"color: #8959a8;\">new<\/span> ConditionEvaluator(registry, environment, resourceLoader);<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">ConfigurationClassParser\u5bf9\u6bcf\u4e2a\u914d\u7f6e\u7c7b\u8fdb\u884c\u89e3\u6790\u7684\u65f6\u5019\u90fd\u4f1a\u4f7f\u7528ConditionEvaluator\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #8959a8;\">if<\/span> (<span style=\"color: #8959a8;\">this<\/span>.conditionEvaluator.shouldSkip(configClass.getMetadata(), ConfigurationPhase.PARSE_CONFIGURATION)) {<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">return<\/span>;<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">ConditionEvaluator\u7684skip\u65b9\u6cd5\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\"><span style=\"color: #4271ae;\"><span style=\"color: #8959a8;\">public<\/span> <span style=\"color: #8959a8;\">boolean<\/span> <span style=\"color: #3e999f;\">shouldSkip<\/span><span style=\"color: #f5871f;\">(AnnotatedTypeMetadata metadata, ConfigurationPhase phase)<\/span> <\/span>{<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u8fd9\u4e2a\u7c7b\u6ca1\u6709\u88ab@Conditional\u6ce8\u89e3\u6240\u4fee\u9970\uff0c\u4e0d\u4f1askip<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">if<\/span> (metadata == <span style=\"color: #8959a8;\">null<\/span> || !metadata.isAnnotated(Conditional.class.getName())) {<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">return<\/span> <span style=\"color: #8959a8;\">false<\/span>;<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u5982\u679c\u53c2\u6570\u4e2d\u6c92\u6709\u8bbe\u7f6e\u6761\u4ef6\u6ce8\u89e3\u7684\u751f\u6548\u9636\u6bb5<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">if<\/span> (phase == <span style=\"color: #8959a8;\">null<\/span>) {<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8e908c;\">\/\/ \u662f\u914d\u7f6e\u7c7b\u7684\u8bdd\u76f4\u63a5\u4f7f\u7528PARSE_CONFIGURATION\u9636\u6bb5<\/span><\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (metadata <span style=\"color: #8959a8;\">instanceof<\/span> AnnotationMetadata &amp;&amp;<\/span>\n<span style=\"height: 20px;\">        ConfigurationClassUtils.isConfigurationCandidate((AnnotationMetadata) metadata)) {<\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">return<\/span> shouldSkip(metadata, ConfigurationPhase.PARSE_CONFIGURATION);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8e908c;\">\/\/ \u5426\u5219\u4f7f\u7528REGISTER_BEAN\u9636\u6bb5<\/span><\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">return<\/span> shouldSkip(metadata, ConfigurationPhase.REGISTER_BEAN);<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u8981\u89e3\u6790\u7684\u914d\u7f6e\u7c7b\u7684\u6761\u4ef6\u96c6\u5408<\/span><\/span>\n<span style=\"height: 20px;\">  List&lt;Condition&gt; conditions = <span style=\"color: #8959a8;\">new<\/span> ArrayList&lt;Condition&gt;();<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u83b7\u53d6\u914d\u7f6e\u7c7b\u7684\u6761\u4ef6\u6ce8\u89e3\u5f97\u5230\u6761\u4ef6\u6570\u636e\uff0c\u5e76\u6dfb\u52a0\u5230\u96c6\u5408\u4e2d<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">for<\/span> (String[] conditionClasses : getConditionClasses(metadata)) {<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">for<\/span> (String conditionClass : conditionClasses) {<\/span>\n<span style=\"height: 20px;\">      Condition condition = getCondition(conditionClass, <span style=\"color: #8959a8;\">this<\/span>.context.getClassLoader());<\/span>\n<span style=\"height: 20px;\">      conditions.add(condition);<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u5bf9\u6761\u4ef6\u96c6\u5408\u505a\u4e2a\u6392\u5e8f<\/span><\/span>\n<span style=\"height: 20px;\">  AnnotationAwareOrderComparator.sort(conditions);<\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8e908c;\">\/\/ \u904d\u5386\u6761\u4ef6\u96c6\u5408<\/span><\/span>\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">for<\/span> (Condition condition : conditions) {<\/span>\n<span style=\"height: 20px;\">    ConfigurationPhase requiredPhase = <span style=\"color: #8959a8;\">null<\/span>;<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (condition <span style=\"color: #8959a8;\">instanceof<\/span> ConfigurationCondition) {<\/span>\n<span style=\"height: 20px;\">      requiredPhase = ((ConfigurationCondition) condition).getConfigurationPhase();<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8e908c;\">\/\/ \u6ca1\u6709\u8fd9\u4e2a\u89e3\u6790\u7c7b\u4e0d\u9700\u8981\u9636\u6bb5\u7684\u5224\u65ad\u6216\u8005\u89e3\u6790\u7c7b\u548c\u53c2\u6570\u4e2d\u7684\u9636\u6bb5\u4e00\u81f4\u624d\u4f1a\u7ee7\u7eed\u8fdb\u884c<\/span><\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">if<\/span> (requiredPhase == <span style=\"color: #8959a8;\">null<\/span> || requiredPhase == phase) {<\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8e908c;\">\/\/ \u9636\u6bb5\u4e00\u81f4\u5207\u4e0d\u6ee1\u8db3\u6761\u4ef6\u7684\u8bdd\uff0c\u8fd4\u56detrue\u5e76\u8df3\u8fc7\u8fd9\u4e2abean\u7684\u89e3\u6790<\/span><\/span>\n<span style=\"height: 20px;\">      <span style=\"color: #8959a8;\">if<\/span> (!condition.matches(<span style=\"color: #8959a8;\">this<\/span>.context, metadata)) {<\/span>\n<span style=\"height: 20px;\">        <span style=\"color: #8959a8;\">return<\/span> <span style=\"color: #8959a8;\">true<\/span>;<\/span>\n<span style=\"height: 20px;\">      }<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">  }<\/span>\n\n<span style=\"height: 20px;\">  <span style=\"color: #8959a8;\">return<\/span> <span style=\"color: #8959a8;\">false<\/span>;<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">SpringBoot\u5728\u6761\u4ef6\u6ce8\u89e3\u7684\u89e3\u6790log\u8bb0\u5f55\u5728\u4e86ConditionEvaluationReport\u7c7b\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7BeanFactory\u83b7\u53d6(BeanFactory\u662f\u6709\u7236\u5b50\u5173\u7cfb\u7684\uff1b\u6bcf\u4e2aBeanFactory\u90fd\u5b58\u6709\u4e00\u4efdConditionEvaluationReport\uff0c\u4e92\u4e0d\u76f8\u5e72)\uff1a<\/span><\/p>\n<figure style=\"margin-top: 20px; margin-bottom: 20px; overflow: auto; padding: 15px; font-size: 13px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; white-space: normal;\">\n<table style=\"width: 768px;\" width=\"NaN\">\n<tbody>\n<tr style=\"background-color: #f9f9f9;\">\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; user-select: none; border: initial none initial;\"><\/td>\n<td style=\"padding: 0px; text-align: left; vertical-align: middle; border: initial none initial;\">\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; padding: 1px; background: #f7f7f7; line-height: 1.6; text-align: left; border: initial none initial;\"><span style=\"height: 20px;\">ConditionEvaluationReport conditionEvaluationReport = beanFactory.getBean(<span style=\"color: #718c00;\">\"autoConfigurationReport\"<\/span>, ConditionEvaluationReport.class);<\/span>\n<span style=\"height: 20px;\">Map&lt;String, ConditionEvaluationReport.ConditionAndOutcomes&gt; result = conditionEvaluationReport.getConditionAndOutcomesBySource();<\/span>\n<span style=\"height: 20px;\"><span style=\"color: #8959a8;\">for<\/span>(String key : result.keySet()) {<\/span>\n<span style=\"height: 20px;\">    ConditionEvaluationReport.ConditionAndOutcomes conditionAndOutcomes = result.get(key);<\/span>\n<span style=\"height: 20px;\">    Iterator&lt;ConditionEvaluationReport.ConditionAndOutcome&gt; iterator = conditionAndOutcomes.iterator();<\/span>\n<span style=\"height: 20px;\">    <span style=\"color: #8959a8;\">while<\/span>(iterator.hasNext()) {<\/span>\n<span style=\"height: 20px;\">        ConditionEvaluationReport.ConditionAndOutcome conditionAndOutcome = iterator.next();<\/span>\n<span style=\"height: 20px;\">        System.out.println(key + <span style=\"color: #718c00;\">\" -- \"<\/span> + conditionAndOutcome.getCondition().getClass().getSimpleName() + <span style=\"color: #718c00;\">\" -- \"<\/span> + conditionAndOutcome.getOutcome());<\/span>\n<span style=\"height: 20px;\">    }<\/span>\n<span style=\"height: 20px;\">}<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"margin-bottom: 25px; color: rgb(0 0 0); font-family: Lato, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; white-space: normal; background-color: #ffffff; text-align: left;\"><span style=\"font-size: 16px;\">\u6253\u5370\u51fa\u6761\u4ef6\u6ce8\u89e3\u4e0b\u7684\u7c7b\u52a0\u8f7d\u4fe1\u606f\uff1a<\/span><\/p>\n<pre style=\"overflow: auto; font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; font-size: 13px; margin-top: 20px; margin-bottom: 20px; padding: 15px; color: #4d4d4c; background: #f7f7f7; line-height: 1.6; text-align: left;\"><code style=\"font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', monospace; background: none; border-radius: 3px; text-shadow: none;\">.......\norg.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: freemarker.template.Configuration,org.springframework.ui.freemarker.FreeMarkerConfigurationFactory\norg.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: groovy.text.markup.MarkupTemplateEngine\norg.springframework.boot.autoconfigure.gson.GsonAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: com.google.gson.Gson\norg.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: org.h2.server.web.WebServlet\norg.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: org.springframework.hateoas.Resource,org.springframework.plugin.core.Plugin\norg.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration -- OnClassCondition -- required @ConditionalOnClass classes not found: com.hazelcast.core.HazelcastInstance\n.......<\/code><\/pre>\n<blockquote style=\"margin-top: 20px; margin-bottom: 20px; padding: 5px; outline: 0px; border-left-width: 5px; border-left-color: #dddfe4; color: var(--weui-fg-1); letter-spacing: 0.544px; white-space: normal; text-align: start; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; background: none 0% 0% repeat scroll #eef0f4; overflow: auto; word-break: break-word !important;\">\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; font-size: 12px; color: #999999; line-height: 22px;\">\u4e36Format<\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; font-size: 12px; color: #999999; line-height: 22px;\">https:\/\/www.jianshu.com\/p\/c4df7be75d6e<\/p>\n<\/blockquote>\n<section style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; font-size: 12px; text-align: center;\"><span style=\"outline: 0px;\">\u516c\u4f17\u53f7\u201cJava\u7cbe\u9009\u201d\u6240\u53d1\u8868\u5185\u5bb9\u6ce8\u660e\u6765\u6e90\u7684\uff0c\u7248\u6743\u5f52\u539f\u51fa\u5904\u6240\u6709\uff08\u65e0\u6cd5\u67e5\u8bc1\u7248\u6743\u7684\u6216\u8005\u672a\u6ce8\u660e\u51fa\u5904\u7684\u5747\u6765\u81ea\u7f51\u7edc\uff0c\u7cfb\u8f6c\u8f7d\uff0c\u8f6c\u8f7d\u7684\u76ee\u7684\u5728\u4e8e\u4f20\u9012\u66f4\u591a\u4fe1\u606f\uff0c\u7248\u6743\u5c5e\u4e8e\u539f\u4f5c\u8005\u3002\u5982\u6709\u4fb5\u6743\uff0c\u8bf7\u8054\u7cfb\uff0c\u7b14\u8005\u4f1a\u7b2c\u4e00\u65f6\u95f4\u5220\u9664\u5904\u7406\uff01<\/span><\/section>\n<section style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; font-size: 12px; text-align: center;\"><\/section>\n<p style=\"margin-bottom: 20px; padding: 15px 10px; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; line-height: 18px; background: #6a5f65; color: white; border-radius: 8px;\"><span style=\"outline: 0px; font-size: 14px;\">\u6700\u8fd1\u6709\u5f88\u591a\u4eba\u95ee\uff0c\u6709\u6ca1\u6709<strong style=\"outline: 0px; color: #f5f179;\">\u8bfb\u8005<\/strong>\u4ea4\u6d41\u7fa4\uff01\u52a0\u5165\u65b9\u5f0f\u5f88\u7b80\u5355\uff0c\u516c\u4f17\u53f7<strong style=\"outline: 0px; color: #f5f179;\">Java\u7cbe\u9009<\/strong>\uff0c\u56de\u590d\u201c<strong style=\"outline: 0px; color: #f5f179;\">\u52a0\u7fa4<\/strong>\u201d\uff0c\u5373\u53ef\u5165\u7fa4\uff01<\/span><\/p>\n<p style=\"margin-bottom: 10px; padding: 16px 10px; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; line-height: 18px; background: #595e66; color: white; border-radius: 8px;\"><span style=\"outline: 0px; font-size: 14px; color: #ff4c41; text-decoration: underline;\"><strong style=\"outline: 0px;\"><a class=\"weapp_text_link\" style=\"outline: 0px; color: var(--weui-link); cursor: pointer;\" data-miniprogram-appid=\"wx68acf364e3423488\" data-miniprogram-path=\"pages\/home\/index\" data-miniprogram-nickname=\"Java\u7cbe\u9009\u9762\u8bd5\u9898\" data-miniprogram-type=\"text\" data-miniprogram-servicetype=\"0\"><span style=\"outline: 0px; color: #2cd7df; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: pointer;\">Java\u7cbe\u9009\u9762\u8bd5\u9898<\/span><\/a><\/strong><\/span><span style=\"outline: 0px; font-size: 14px;\">\uff08\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\uff09\uff1a<strong style=\"outline: 0px; color: #f76262;\">3000+<\/strong>\u9053\u9762\u8bd5\u9898\uff0c\u5305\u542bJava\u57fa\u7840\u3001\u5e76\u53d1\u3001JVM\u3001\u7ebf\u7a0b\u3001MQ\u7cfb\u5217\u3001Redis\u3001Spring\u7cfb\u5217\u3001Elasticsearch\u3001Docker\u3001K8s\u3001Flink\u3001Spark\u3001\u67b6\u6784\u8bbe\u8ba1\u7b49\uff0c\u5728\u7ebf\u968f\u65f6\u5237\u9898\uff01<\/span><\/p>\n<section style=\"margin-top: 0.75em; margin-bottom: 1em; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; text-align: center;\"><span style=\"outline: 0px;\">------ \u7279\u522b\u63a8\u8350 ------<\/span><\/section>\n<p style=\"margin-bottom: 20px; padding: 15px 10px; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; line-height: 18px; background: #9c583e; color: white; border-radius: 8px;\"><span style=\"outline: 0px; font-size: 14px;\">\u7279\u522b\u63a8\u8350\uff1a\u4e13\u6ce8\u5206\u4eab\u6700\u524d\u6cbf\u7684\u6280\u672f\u4e0e\u8d44\u8baf\uff0c\u4e3a\u5f2f\u9053\u8d85\u8f66\u505a\u597d\u51c6\u5907\u53ca\u5404\u79cd\u5f00\u6e90\u9879\u76ee\u4e0e\u9ad8\u6548\u7387\u8f6f\u4ef6\u7684\u516c\u4f17\u53f7\uff0c<strong style=\"outline: 0px; color: #1de7c2;\">\u300c\u5927\u5496\u7b14\u8bb0\u300d<\/strong>\uff0c\u4e13\u6ce8\u6316\u6398\u597d\u4e1c\u897f\uff0c\u975e\u5e38\u503c\u5f97\u5927\u5bb6\u5173\u6ce8\u3002<strong style=\"outline: 0px; color: #1de7c2;\">\u70b9\u51fb\u4e0b\u65b9\u516c\u4f17\u53f7\u5361\u7247\u5173\u6ce8<\/strong>\u3002<\/span><\/p>\n<section class=\"mp_profile_iframe_wrp\" style=\"margin-right: auto; margin-left: auto; outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; letter-spacing: normal; caret-color: #000000; font-size: 0px; text-align: center; color: #333333;\"><\/section>\n<section style=\"outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; white-space: normal; font-size: medium; letter-spacing: normal; caret-color: #000000; color: #121212; font-variant-numeric: normal; text-align: right; border: 0px none initial;\" data-tools=\"\u516c\u4f17\u53f7\uff1aJava\u7cbe\u9009\" data-id=\"91842\">\n<section style=\"outline: 0px; display: inline-block; clear: both;\">\n<section style=\"padding: 18px 15px 20px 10px; outline: 0px; color: #5692d6; text-align: center; letter-spacing: 1.5px; background-image: url('https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/tJdrRlG3mibwIZhlX6v8QLIEwUjKJ6pzYQt1nP6Xe3zOOL0MwuO7pUz5cq3R09MBWPpmIyZP7XnbLSDaviaau5uA\/640?wx_fmt=png'); background-size: 100% 100%; background-repeat: no-repeat; font-size: 16px;\" data-brushtype=\"text\">\n<section style=\"outline: 0px; display: flex; justify-content: center; align-items: center;\">\n<section style=\"outline: 0px; color: rgba(0, 0, 0, 0.75); text-align: left;\" data-brushtype=\"text\"><span style=\"outline: 0px; font-size: 14px; color: #595e66;\">\u70b9\u51fb\u201c\u9605\u8bfb\u539f\u6587\u201d\uff0c\u4e86\u89e3\u66f4\u591a\u7cbe\u5f69\u5185\u5bb9\uff01<\/span><\/section>\n<section style=\"outline: 0px; color: rgba(0, 0, 0, 0.75); text-align: right;\" data-brushtype=\"text\"><span style=\"outline: 0px; font-size: 14px; color: #9c583e;\">\u6587\u7ae0\u6709\u5e2e\u52a9\u7684\u8bdd\uff0c\u70b9\u5728\u770b\uff0c\u8f6c\u53d1\u5427\uff01<\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"display: none;\">\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4f5c\u8005\uff1a\u70b9\u51fb\u5173\u6ce8 ? Java\u7cbe\u9009 Java\u7cbe\u9009 \u5fae\u4fe1\u53f7 w_z90110 \u529f\u80fd\u4ecb\u7ecd \u4e13\u6ce8\u5206\u4eab\u524d\u6cbf\u8d44\u8baf\uff0cBATJ \u5927\u5382\u9762\u8bd5\u9898\u89e3\u8bfb\uff0c\u67b6\u6784\u6280\u672f\u5e72\u8d27\uff0c\u5fae\u670d\u52a1\u3001\u9ad8\u53ef\u7528\u7b49\u67b6\u6784\u8bbe\u8ba1\uff0c10\u5e74\u5f00\u53d1\u8001\u5175\u5e2e\u4f60\u5c11\u8d70\u5f2f\u8def\uff0c\u6b22\u8fce\u5404\u9886\u57df\u7a0b\u5e8f\u5458\u4ea4\u6d41\u5b66\u4e60\uff01 \u53d1\u8868\u4e8e<br \/>\n\u8f6c\u8f7d\u5730\u5740\uff1ahttps:\/\/mp.weixin.qq.com\/s\/IscLflpwSQwz3G8UNXWMAA<\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>SpringBoot\u5185\u90e8\u63d0\u4f9b\u4e86\u7279\u6709\u7684\u6ce8\u89e3\uff1a\u6761\u4ef6\u6ce8\u89e3\uff08Conditional Annotation\uff09\u3002\u6bd4\u5982 @Conditional &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7,30],"tags":[],"class_list":["post-2985","post","type-post","status-publish","format-standard","hentry","category-spring-boot","category-30"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/2023071417572174747f072.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/202307141757212b2bb90ff.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-21\/202307141757212b2bb90ff.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/20230714175722c9c9567a2.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/20230714175722c9c9567a2.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/202307141757222727905cf.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-22\/202307141757222727905cf.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723989868990.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723989868990.png","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723c0c0e3e45.png","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/default\/nine\/2023-07-14\/17-57-23\/20230714175723c0c0e3e45.png","id":"image11"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2023-07-14","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":344,"next_post_id":3003,"next_post_title":"Spring Boot\u9879\u76ee\u4e2d\u5206\u5e03\u5f0f\u9501\u5b9e\u73b0\u65b9\u6848\uff1aRedisson","previous_post_id":2983,"previous_post_title":"\u901a\u8fc7\u5de5\u5382\u6a21\u5f0f\u5b9e\u73b0SpringBoot+MQTT-\u8ba2\u9605\u4e0e\u6d88\u8d39","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2985","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=2985"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2985\/revisions"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}