Java Code Examples for org.springframework.beans.factory.support.BeanDefinitionBuilder

Following code examples demonstrate how to use org.springframework.beans.factory.support.BeanDefinitionBuilder from spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.beans.factory.support.BeanDefinitionBuilder and various code implementation of this class.
Example 1
Project : spring-framework Source File : MongoRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

		AnnotationAttributes attributes = config.getAttributes();

		builder.addPropertyReference("mongoOperations", attributes.getString("mongoTemplateRef"));
		builder.addPropertyValue("createIndexesForQueryMethods", attributes.getBoolean("createIndexesForQueryMethods"));
	}
			
Example 2
Project : spring-framework Source File : MongoRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config) {

		Element element = config.getElement();

		ParsingUtils.setPropertyReference(builder, element, MONGO_TEMPLATE_REF, "mongoOperations");
		ParsingUtils.setPropertyValue(builder, element, CREATE_QUERY_INDEXES, "createIndexesForQueryMethods");
	}
			
Example 3
Project : spring-framework Source File : PropertiesBeanDefinitionParser.java View Source Code on GitHub

	protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		
		List<?> propertyElements = DomUtils.getChildElementsByTagName(element, "property");
		for (Iterator<?> iterator = propertyElements.iterator(); iterator.hasNext();) {
			Element property = (Element) iterator.next();
			parserContext.getDelegate().parsePropertyElement(property, builder.getBeanDefinition());
		}
		
		builder.addPropertyValue("ignoreResourceNotFound", true);
		builder.addPropertyValue("ignoreUnresolvablePlaceholders", true);
	}
			
Example 4
Project : spring-framework Source File : TestScanRegistrar.java View Source Code on GitHub

    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {


        BeanDefinitionBuilder builder = rootBeanDefinition(TestBeanPostProcessor.class);
        AbstractBeanDefinition beanDefinition = builder.getBeanDefinition();
        BeanDefinitionReaderUtils.registerWithGeneratedName(beanDefinition, registry);
        log.info("TestScanRegistrar {}", "registerBeanDefinitionsregisterBeanDefinitionsregisterBeanDefinitionsregisterBeanDefinitions");

    }
			
Example 5
Project : spring-framework Source File : CassandraRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config) {

		Element element = config.getElement();

				.orElse(DefaultBeanNames.DATA_TEMPLATE);

		builder.addPropertyReference("cassandraTemplate", cassandraTemplateRef);
	}
			
Example 6
Project : spring-framework Source File : CassandraRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

		String cassandraTemplateRef = config.getAttributes().getString("cassandraTemplateRef");

		if (StringUtils.hasText(cassandraTemplateRef)) {
			builder.addPropertyReference("cassandraTemplate", cassandraTemplateRef);
		}
	}
			
Example 7
Project : spring-framework Source File : AbstractSpringBeanDefinitionParser.java View Source Code on GitHub

    public void doParse(Element element, BeanDefinitionBuilder builder) {
        builder.addPropertyReference("bundleContext", "bundleContext");
        prepareInjection(element, builder);
        builder.setLazyInit(false);
        builder.setInitMethodName("start");
        builder.setDestroyMethodName("stop");
        super.doParse(element, builder);
    }
			
Example 8
Project : spring-framework Source File : TestRiptideRegistrar.java View Source Code on GitHub

    private void registerAsyncClientHttpRequestFactory(final String id) {
        registry.registerIfAbsent(id, AsyncClientHttpRequestFactory.class, () -> {
            log.debug("Client [{}]: Registering mocked AsyncClientHttpRequestFactory", id);
            final BeanDefinitionBuilder factory = genericBeanDefinition(AsyncClientHttpRequestFactory.class);
            factory.addDependsOn(RiptideTestAutoConfiguration.SERVER_BEAN_NAME);
            factory.setFactoryMethodOnBean("getAsyncRequestFactory", RiptideTestAutoConfiguration.TEMPLATE_BEAN_NAME);
            return factory;
        });
    }
			
Example 9
Project : spring-framework Source File : CassandraSessionParser.java View Source Code on GitHub

	protected void setDefaultProperties(BeanDefinitionBuilder builder) {

		super.setDefaultProperties(builder);

		addRequiredPropertyValue(builder, "schemaAction", SchemaAction.NONE.name());
		addRequiredPropertyReference(builder, "converter", DefaultBeanNames.CONVERTER);
	}
			
Example 10
Project : spring-framework Source File : Neo4jRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

		AnnotationAttributes attributes = config.getAttributes();

		builder.addPropertyReference("neo4jTemplate", attributes.getString(ANN_NEO4J_TEMPLATE_REF));
		builder.addPropertyReference("neo4jMappingContext", DEFAULT_NEO4J_MAPPING_CONTEXT_REF);
	}
			
Example 11
Project : spring-framework Source File : Neo4jRepositoryConfigurationExtension.java View Source Code on GitHub

	public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config) {

		Element element = config.getElement();

		String templateRef = element.getAttribute(NEO4J_TEMPLATE_REF);
		templateRef = StringUtils.hasText(templateRef) ? templateRef : DEFAULT_NEO4J_TEMPLATE_REF;
		builder.addPropertyReference("neo4jTemplate", templateRef);
		builder.addPropertyReference("neo4jMappingContext", DEFAULT_NEO4J_MAPPING_CONTEXT_REF);
	}
			
Example 12
Project : spring-framework Source File : PeopleBeanDefinitionParser.java View Source Code on GitHub

	protected void doParse(Element element, BeanDefinitionBuilder builder) {
		String name=element.getAttribute("name");
		String age=element.getAttribute("age");
		String id = element.getAttribute("id");
		if (StringUtils.hasText(id)) {  
			builder.addPropertyValue("id", id);  
        }  
        if (StringUtils.hasText(name)) {  
        	builder.addPropertyValue("name", name);  
        }  
        if (StringUtils.hasText(age)) {  
        	builder.addPropertyValue("age", Integer.valueOf(age));  
        } 
	}