Interpretation of source code based on Annotation configuration Bean Definition
The first part of this series analyzes the source code of the <bean/> element in the spring parsing XML configuration file, which is the original configuration of spring and also makes the nodes in XML have namespace attributes. Refer to the Spring related documentation if you have the following configuration: <context:component-scan base-package= "Com.colorcc.spring.sample"/>: First, the element uses the " Http://www.springframework.org/schema/context how the namespace is configured. Second, for each object in the "Com.colorcc.spring.sample" package, spring may configure and resolve the corresponding object based on a Annotation approach. This may be because it is also necessary to use annotations such as @Component and its child Annotation in the relevant Java code.
Annotation-based Bean parsing portal
As shown in Figure 2 above, the last Loop sequence diagram in the lower-right corner is the entry for the parse Bean for the Annotation configuration, so its detailed steps refer to the analysis in Figure 2 above. XML Context Namespace Bean element parsing is shown in listing 6 above, and if you take the "Http://www.springframework.org/schema/context" namespace, execute the The Delegate.parsecustomelement (Ele) method parses the Bean element, as shown in Figure 1 and Figure 2.
Figure 1. Sequence diagram for parsing beans based on Annotation –part1
Figure 2. Sequence diagram for parsing beans based on Annotation –part2