主类示例源代码如下:

配置类源码如下:

进入context.register方法:

进入this.reader.register方法:

进入registerBean方法:

进入doRegisterBean方法:

进入AnnotatedGenericBeanDefinition构造方法:

进入AnnotationMetadata的introspect方法:

进入StandardAnnotationMetadata的from方法:

进入StandartAnnotationMetadata的构造方法:

进入MergedAnnotations的from方法:

进入TypeMappedAnnotations的from方法:

进入AnnotationsScanner的isKnownEmpty方法:

进入getDeclaredAnnotations方法,运行到红线标识的位置(如下图):

此时,AnnotatedElement类型的source对象里就包含了我们在类上配置的注解:




















