// Path: elastic-config-spring/src/main/java/com/github/config/spring/datasource/RegistryPropertySources.java
// public class RegistryPropertySources extends MutablePropertySources {
//     public RegistryPropertySources(final ElasticConfig registryCenter) {
//         addLast(new RegistryPropertySource(registryCenter));
//     }
// }
// 
// Path: elastic-config-spring/src/main/java/com/github/config/spring/datasource/tag/ZookeeperConfigBeanDefinitionParserTag.java
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class ZookeeperConfigBeanDefinitionParserTag {
// 
//     public static final String REGISTRY_CENTER_REF_ATTRIBUTE = "registry-center-ref";
// 
//     public static final String SERVERLIST_ATTRIBUTE = "serverlist";
// 
//     public static final String NAMESPACE_ATTRIBUTE = "namespace";
// 
//     public static final String PROJECT_ATTRIBUTE = "project";
// 
//     public static final String CONFIG_ATTRIBUTE = "node";
// 
//     public static final String VERSION_ATTRIBUTE = "version";
// 
//     public static final String REGISTER_CONFIG_ELEMENT = "config";
// 
//     public static final String CONFIG_REFRESH = "refresh";
// 
//     public static final String REGISTER_PLACEHOLDER_ELEMENT = "placeholder";
// 
// }


import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.w3c.dom.Element;
import com.github.config.spring.datasource.RegistryPropertySources;
import com.github.config.spring.datasource.tag.ZookeeperConfigBeanDefinitionParserTag;
package com.github.config.spring.namespace.parser;



/**
 * 注册中心占位符命名空间解析器.
 * 
 * @author ZhangWei
 */
public class PlaceholderBeanDefinitionParser extends AbstractBeanDefinitionParser {

    @Override
    protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
        BeanDefinitionBuilder factory = BeanDefinitionBuilder
            .rootBeanDefinition(PropertySourcesPlaceholderConfigurer.class);
        BeanDefinitionBuilder definitionBuilder = BeanDefinitionBuilder
// Path: elastic-config-spring/src/main/java/com/github/config/spring/datasource/RegistryPropertySources.java
// public class RegistryPropertySources extends MutablePropertySources {
//     public RegistryPropertySources(final ElasticConfig registryCenter) {
//         addLast(new RegistryPropertySource(registryCenter));
//     }
// }
// 
// Path: elastic-config-spring/src/main/java/com/github/config/spring/datasource/tag/ZookeeperConfigBeanDefinitionParserTag.java
// @NoArgsConstructor(access = AccessLevel.PRIVATE)
// public class ZookeeperConfigBeanDefinitionParserTag {
// 
//     public static final String REGISTRY_CENTER_REF_ATTRIBUTE = "registry-center-ref";
// 
//     public static final String SERVERLIST_ATTRIBUTE = "serverlist";
// 
//     public static final String NAMESPACE_ATTRIBUTE = "namespace";
// 
//     public static final String PROJECT_ATTRIBUTE = "project";
// 
//     public static final String CONFIG_ATTRIBUTE = "node";
// 
//     public static final String VERSION_ATTRIBUTE = "version";
// 
//     public static final String REGISTER_CONFIG_ELEMENT = "config";
// 
//     public static final String CONFIG_REFRESH = "refresh";
// 
//     public static final String REGISTER_PLACEHOLDER_ELEMENT = "placeholder";
// 
// }


// Path: elastic-config-spring/src/main/java/com/github/config/spring/namespace/parser/PlaceholderBeanDefinitionParser.java
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.w3c.dom.Element;
import com.github.config.spring.datasource.RegistryPropertySources;
import com.github.config.spring.datasource.tag.ZookeeperConfigBeanDefinitionParserTag;

package com.github.config.spring.namespace.parser;



/**
 * 注册中心占位符命名空间解析器.
 * 
 * @author ZhangWei
 */
public class PlaceholderBeanDefinitionParser extends AbstractBeanDefinitionParser {

    @Override
    protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
        BeanDefinitionBuilder factory = BeanDefinitionBuilder
            .rootBeanDefinition(PropertySourcesPlaceholderConfigurer.class);
        BeanDefinitionBuilder definitionBuilder = BeanDefinitionBuilder
            .rootBeanDefinition(RegistryPropertySources.class);