默认标签的解析(2019-02-20)

    parseDefaultElement函数解析默认标签, 分为4种(import、 alias、 bean、 beans)不同的处理

bean标签的解析及注册

    protected void processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate) {

        BeanDefinitionHolder bdHolder = delegate.parseBeanDefinitionElement(ele);

        if (bdHolder !=null) {

            bdHolder = delegate.decorateBeanDefinitionIfRequired(ele, bdHolder);

            try {

                // Register the final decorated instance.

                BeanDefinitionReaderUtils.registerBeanDefinition(bdHolder, getReaderContext().getRegistry());

            }

            catch (BeanDefinitionStoreException ex) {

                getReaderContext().error("Failed to register bean definition with name '" +

                bdHolder.getBeanName() +"'", ele, ex);

            }

            // Send registration event.

            getReaderContext().fireComponentRegistered(new BeanComponentDefinition(bdHolder));

        }

    }

你可能感兴趣的:(默认标签的解析(2019-02-20))