From ffc0872e7b58549f57f031d69ab966ae980781a9 Mon Sep 17 00:00:00 2001 From: xuchengsheng Date: Thu, 9 Nov 2023 12:05:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96XmlBeanDefinitionReader?= =?UTF-8?q?=E6=BA=90=E7=A0=81=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../README.md | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/spring-beans/spring-bean-xmlBeanDefinitionReader/README.md b/spring-beans/spring-bean-xmlBeanDefinitionReader/README.md index bc9f02c..d4e9c10 100644 --- a/spring-beans/spring-bean-xmlBeanDefinitionReader/README.md +++ b/spring-beans/spring-bean-xmlBeanDefinitionReader/README.md @@ -114,6 +114,7 @@ XmlBeanDefinitionReader->>XmlBeanDefinitionReader:doLoadDocument(inputSource,res note over XmlBeanDefinitionReader: 调用doLoadDocument方法解析XML XmlBeanDefinitionReader->>DefaultDocumentLoader:loadDocument(...) +note over XmlBeanDefinitionReader,DefaultDocumentLoader: 加载XML DefaultDocumentLoader->>XmlBeanDefinitionReader:返回Document @@ -134,8 +135,13 @@ note over XmlBeanDefinitionReader,DefaultBeanDefinitionDocumentReader: 调用reg loop Every minute DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:doRegisterBeanDefinitions(root) + note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理beans标签 + DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:parseBeanDefinitions(root,delegate) + note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理“import”、“alias”、“bean”标签 + DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:parseDefaultElement(ele,delegate) + note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 解析默认元素 alt 如果是import标签 DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:importBeanDefinitionResource(ele) @@ -146,16 +152,17 @@ loop Every minute note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理alias标签 else 如果是bean标签 - DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:processBeanDefinition(ele, delegate) - note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理bean标签 - DefaultBeanDefinitionDocumentReader->>XmlBeanDefinitionReader:getRegistry() - note over DefaultBeanDefinitionDocumentReader,XmlBeanDefinitionReader: 获取BeanDefinitionRegistry - XmlBeanDefinitionReader->>DefaultBeanDefinitionDocumentReader:返回BeanDefinitionRegistry - DefaultBeanDefinitionDocumentReader->>BeanDefinitionReaderUtils:registerBeanDefinition(definitionHolder,registry) - note over DefaultBeanDefinitionDocumentReader,BeanDefinitionReaderUtils: 注册Bean定义 - BeanDefinitionReaderUtils->>BeanDefinitionReaderUtils:registerBeanDefinition(beanName,beanDefinition) - note over BeanDefinitionReaderUtils: 注册Bean定义到容器 - + rect rgb(207,207,207) + DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:processBeanDefinition(ele, delegate) + note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理bean标签 + DefaultBeanDefinitionDocumentReader->>XmlBeanDefinitionReader:getRegistry() + note over DefaultBeanDefinitionDocumentReader,XmlBeanDefinitionReader: 获取BeanDefinitionRegistry + XmlBeanDefinitionReader->>DefaultBeanDefinitionDocumentReader:返回BeanDefinitionRegistry + DefaultBeanDefinitionDocumentReader->>BeanDefinitionReaderUtils:registerBeanDefinition(definitionHolder,registry) + note over DefaultBeanDefinitionDocumentReader,BeanDefinitionReaderUtils: 注册Bean定义 + BeanDefinitionReaderUtils->>BeanDefinitionReaderUtils:registerBeanDefinition(beanName,beanDefinition) + note over BeanDefinitionReaderUtils: 注册Bean定义到容器 + end else 如果是beans标签 DefaultBeanDefinitionDocumentReader->>DefaultBeanDefinitionDocumentReader:doRegisterBeanDefinitions(ele) note over DefaultBeanDefinitionDocumentReader,DefaultBeanDefinitionDocumentReader: 处理beans标签(重新递归)