当前位置: 首页>>代码示例>>Java>>正文


Java BeanDefinitionBuilder.addConstructorArgReference方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArgReference方法的典型用法代码示例。如果您正苦于以下问题:Java BeanDefinitionBuilder.addConstructorArgReference方法的具体用法?Java BeanDefinitionBuilder.addConstructorArgReference怎么用?Java BeanDefinitionBuilder.addConstructorArgReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.support.BeanDefinitionBuilder的用法示例。


在下文中一共展示了BeanDefinitionBuilder.addConstructorArgReference方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseDeclareParents

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
/**
 * Parse a '{@code declare-parents}' element and register the appropriate
 * DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the
 * supplied ParserContext.
 */
private AbstractBeanDefinition parseDeclareParents(Element declareParentsElement, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(DeclareParentsAdvisor.class);
	builder.addConstructorArgValue(declareParentsElement.getAttribute(IMPLEMENT_INTERFACE));
	builder.addConstructorArgValue(declareParentsElement.getAttribute(TYPE_PATTERN));

	String defaultImpl = declareParentsElement.getAttribute(DEFAULT_IMPL);
	String delegateRef = declareParentsElement.getAttribute(DELEGATE_REF);

	if (StringUtils.hasText(defaultImpl) && !StringUtils.hasText(delegateRef)) {
		builder.addConstructorArgValue(defaultImpl);
	}
	else if (StringUtils.hasText(delegateRef) && !StringUtils.hasText(defaultImpl)) {
		builder.addConstructorArgReference(delegateRef);
	}
	else {
		parserContext.getReaderContext().error(
				"Exactly one of the " + DEFAULT_IMPL + " or " + DELEGATE_REF + " attributes must be specified",
				declareParentsElement, this.parseState.snapshot());
	}

	AbstractBeanDefinition definition = builder.getBeanDefinition();
	definition.setSource(parserContext.extractSource(declareParentsElement));
	parserContext.getReaderContext().registerWithGeneratedName(definition);
	return definition;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:ConfigBeanDefinitionParser.java

示例2: parse

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {        
    //Sort out the Config Class
    BeanDefinitionBuilder configBuilder 
            = helper.createBeanDefinitionBuilder(element, parserContext,
                    Config.class);
    String configId = helper.getId(null, configBuilder, parserContext);
    helper.parseAttributes(element, parserContext, configBuilder);
    helper.registerBeanDefinition(configBuilder, configId,
            null, parserContext);
    
    //Do the main Redisson bean
    BeanDefinitionBuilder builder 
            = helper.createBeanDefinitionBuilder(element, parserContext,
                    Redisson.class);
    builder.setFactoryMethod("create");
    builder.setDestroyMethodName("shutdown");
    builder.addConstructorArgReference(configId);
    parserContext.getDelegate().parseQualifierElements(element,
            builder.getRawBeanDefinition());
    String id = helper.getId(element, builder, parserContext);
    helper.parseAttributes(element, parserContext, configBuilder);
    //Sort out all the nested elements
    parseChildElements(element, configId, id, builder, parserContext);
    
    helper.registerBeanDefinition(builder, id,
            helper.parseAliase(element), parserContext);
    return builder.getBeanDefinition();
}
 
开发者ID:qq1588518,项目名称:JRediClients,代码行数:30,代码来源:RedissonDefinitionParser.java

示例3: runnableReference

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference runnableReference(String ref, String method, Element taskElement, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
			"org.springframework.scheduling.support.ScheduledMethodRunnable");
	builder.addConstructorArgReference(ref);
	builder.addConstructorArgValue(method);
	return beanReference(taskElement, parserContext, builder);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ScheduledTasksBeanDefinitionParser.java

示例4: intervalTaskReference

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference intervalTaskReference(String runnableBeanName,
		String initialDelay, String interval, Element taskElement, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
			"org.springframework.scheduling.config.IntervalTask");
	builder.addConstructorArgReference(runnableBeanName);
	builder.addConstructorArgValue(interval);
	builder.addConstructorArgValue(StringUtils.hasLength(initialDelay) ? initialDelay : ZERO_INITIAL_DELAY);
	return beanReference(taskElement, parserContext, builder);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:ScheduledTasksBeanDefinitionParser.java

示例5: cronTaskReference

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference cronTaskReference(String runnableBeanName,
		String cronExpression, Element taskElement, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
			"org.springframework.scheduling.config.CronTask");
	builder.addConstructorArgReference(runnableBeanName);
	builder.addConstructorArgValue(cronExpression);
	return beanReference(taskElement, parserContext, builder);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ScheduledTasksBeanDefinitionParser.java

示例6: triggerTaskReference

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private RuntimeBeanReference triggerTaskReference(String runnableBeanName,
		String triggerBeanName, Element taskElement, ParserContext parserContext) {
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
			"org.springframework.scheduling.config.TriggerTask");
	builder.addConstructorArgReference(runnableBeanName);
	builder.addConstructorArgReference(triggerBeanName);
	return beanReference(taskElement, parserContext, builder);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ScheduledTasksBeanDefinitionParser.java

示例7: createJdbcTemplate

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
protected final AbstractBeanDefinition createJdbcTemplate(String dataSourceName) {
	BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(JdbcTemplate.class);
	bdb.addConstructorArgReference(dataSourceName);
	return bdb.getRawBeanDefinition();
}
 
开发者ID:halober,项目名称:spring-boot-starter-dao,代码行数:6,代码来源:AbstractDataBaseBean.java

示例8: buildWorkerNodeRegisterBeanDefinition

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
private AbstractBeanDefinition buildWorkerNodeRegisterBeanDefinition(final Element element, final ParserContext parserContext) {
	 BeanDefinitionBuilder result = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperWorkerRegister.class);
	 result.addConstructorArgReference(element.getAttribute(GeneratorBeanDefinitionTag.REGISTRY_CENTER_REF));
	 result.addConstructorArgValue(buildApplicationConfigurationBeanDefinition(element, parserContext));
	 return result.getBeanDefinition();
}
 
开发者ID:imadcn,项目名称:idworker,代码行数:7,代码来源:GeneratorBeanDefinitionParser.java

示例9: createTransactionManager

import org.springframework.beans.factory.support.BeanDefinitionBuilder; //导入方法依赖的package包/类
protected final AbstractBeanDefinition createTransactionManager(String dataSourceName) {
	BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(DataSourceTransactionManager.class);
	bdb.addConstructorArgReference(dataSourceName);
	return bdb.getRawBeanDefinition();
}
 
开发者ID:halober,项目名称:spring-boot-starter-dao,代码行数:6,代码来源:AbstractDataBaseBean.java


注:本文中的org.springframework.beans.factory.support.BeanDefinitionBuilder.addConstructorArgReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。