本文整理了Java中org.springframework.beans.factory.config.BeanDefinition.setAttribute()
方法的一些代码示例,展示了BeanDefinition.setAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BeanDefinition.setAttribute()
方法的具体详情如下:
包路径:org.springframework.beans.factory.config.BeanDefinition
类名称:BeanDefinition
方法名:setAttribute
暂无
代码示例来源:origin: spring-projects/spring-framework
/**
* Expose the given target class for the specified bean, if possible.
* @param beanFactory the containing ConfigurableListableBeanFactory
* @param beanName the name of the bean
* @param targetClass the corresponding target class
* @since 4.2.3
*/
static void exposeTargetClass(
ConfigurableListableBeanFactory beanFactory, @Nullable String beanName, Class<?> targetClass) {
if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass);
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
Attr objectNameAttribute = (Attr) node;
definition.getBeanDefinition().setAttribute("objectName", objectNameAttribute.getValue());
return definition;
}
}
代码示例来源:origin: spring-projects/spring-framework
beanDef.setAttribute(CONFIGURATION_CLASS_ATTRIBUTE, CONFIGURATION_CLASS_FULL);
beanDef.setAttribute(CONFIGURATION_CLASS_ATTRIBUTE, CONFIGURATION_CLASS_LITE);
beanDef.setAttribute(ORDER_ATTRIBUTE, order);
代码示例来源:origin: org.springframework/spring-context
beanDef.setAttribute(CONFIGURATION_CLASS_ATTRIBUTE, CONFIGURATION_CLASS_FULL);
beanDef.setAttribute(CONFIGURATION_CLASS_ATTRIBUTE, CONFIGURATION_CLASS_LITE);
beanDef.setAttribute(ORDER_ATTRIBUTE, order);
代码示例来源:origin: spring-projects/spring-framework
targetDefinition.setAttribute(AutoProxyUtils.PRESERVE_TARGET_CLASS_ATTRIBUTE, Boolean.TRUE);
代码示例来源:origin: org.mule.modules/mule-module-extensions-spring-support
/**
* Sets the {@link MuleHierarchicalBeanDefinitionParserDelegate#MULE_NO_RECURSE} attribute
* on the given {@code definition}
*
* @param definition a {@link BeanDefinition}
*/
static void setNoRecurseOnDefinition(BeanDefinition definition)
{
definition.setAttribute(MuleHierarchicalBeanDefinitionParserDelegate.MULE_NO_RECURSE, Boolean.TRUE);
}
代码示例来源:origin: org.apache.myfaces.orchestra/myfaces-orchestra-core
private static void setConversationName(BeanDefinition def, String convName)
{
def.setAttribute(BeanDefinitionConversationNameAttrDecorator.CONVERSATION_NAME_ATTRIBUTE,
convName);
}
}
代码示例来源:origin: org.apache.myfaces.orchestra/myfaces-orchestra-core15
private static void setConversationName(BeanDefinition def, String convName)
{
def.setAttribute(BeanDefinitionConversationNameAttrDecorator.CONVERSATION_NAME_ATTRIBUTE,
convName);
}
}
代码示例来源:origin: org.mule.modules/mule-module-spring-config
public static void setFlag(BeanDefinition bean, String flag)
{
bean.setAttribute(flag, Boolean.TRUE);
}
代码示例来源:origin: com.mulesoft.munit/mule-munit-support
protected void setNoRecurseOnDefinition(BeanDefinition definition) {
definition.setAttribute(MuleHierarchicalBeanDefinitionParserDelegate.MULE_NO_RECURSE, Boolean.TRUE);
}
代码示例来源:origin: org.mule.modules/mule-module-devkit-support
protected void setNoRecurseOnDefinition(BeanDefinition definition)
{
definition.setAttribute(MuleHierarchicalBeanDefinitionParserDelegate.MULE_NO_RECURSE, Boolean.TRUE);
}
代码示例来源:origin: org.springframework.boot/spring-boot-test
private void registerImportsConfiguration(BeanDefinitionRegistry registry,
AnnotatedBeanDefinitionReader reader) {
BeanDefinition definition = registerBean(registry, reader,
ImportsConfiguration.BEAN_NAME, ImportsConfiguration.class);
definition.setAttribute(TEST_CLASS_ATTRIBUTE, this.testClass);
}
代码示例来源:origin: org.carewebframework/org.carewebframework.api.core
@Override
public BeanDefinitionHolder decorate(Node source, BeanDefinitionHolder holder, ParserContext ctx) {
holder.getBeanDefinition().setAttribute(attributeName, ((Attr) source).getValue());
return holder;
}
代码示例来源:origin: org.carewebframework/org.carewebframework.api
@Override
public BeanDefinitionHolder decorate(Node source, BeanDefinitionHolder holder, ParserContext ctx) {
holder.getBeanDefinition().setAttribute(attributeName, ((Attr) source).getValue());
return holder;
}
代码示例来源:origin: org.apache.myfaces.orchestra/myfaces-orchestra-core
public BeanDefinitionHolder decorate(
Node node,
BeanDefinitionHolder definition,
ParserContext parserContext)
{
String conversationName = node.getTextContent();
if (conversationName != null && conversationName.length() > 0)
{
definition.getBeanDefinition().setAttribute(CONVERSATION_NAME_ATTRIBUTE, conversationName);
}
return definition;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop
/**
* Expose the given target class for the specified bean, if possible.
* @param beanFactory the containing ConfigurableListableBeanFactory
* @param beanName the name of the bean
* @param targetClass the corresponding target class
* @since 4.2.3
*/
static void exposeTargetClass(
ConfigurableListableBeanFactory beanFactory, @Nullable String beanName, Class<?> targetClass) {
if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass);
}
}
代码示例来源:origin: org.metaeffekt.dcc/dcc-commons
@SuppressWarnings("unchecked")
private void enrichBeanDefinition(BeanDefinitionRegistry registry, String definitionName) {
BeanDefinition definition = registry.getBeanDefinition(definitionName);
List<CapabilityDefinitionReference> ancestors = new ArrayList<>();
ancestors.addAll((List<CapabilityDefinitionReference>) definition.getPropertyValues()
.getPropertyValue(DCCConfigurationBeanDefinitionParser.PROPERTY_CAPABILITY_DEF_ANCESTORS).getValue());
definition.setAttribute(DCCConfigurationBeanDefinitionParser.PROPERTY_CAPABILITY_DEF_ANCESTORS, ancestors);
}
代码示例来源:origin: org.mule.modules/mule-module-spring-config
protected void postProcess(ParserContext context, BeanAssembler assembler, Element element)
{
super.postProcess(context, assembler, element);
BeanDefinition parent = getParentBeanDefinition(element);
parent.setAttribute(OBJECT_FACTORY_SETTER, objectFactoryPropertyName);
}
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Expose the given target class for the specified bean, if possible.
* @param beanFactory the containing ConfigurableListableBeanFactory
* @param beanName the name of the bean
* @param targetClass the corresponding target class
* @since 4.2.3
*/
static void exposeTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName, Class<?> targetClass) {
if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass);
}
}
代码示例来源:origin: org.eclipse.gemini.blueprint/gemini-blueprint-core
public BeanDefinitionHolder parseAsHolder(Element componentElement, ParserContext parserContext) {
// save parser context
this.parserContext = parserContext;
this.defaults = new BlueprintDefaultsDefinition(componentElement.getOwnerDocument(), parserContext);
// let Spring do its standard parsing
BeanDefinitionHolder bdHolder = parseComponentDefinitionElement(componentElement, null);
BeanDefinition bd = bdHolder.getBeanDefinition();
if (bd != null) {
bd.setAttribute(ParsingUtils.BLUEPRINT_MARKER_NAME, Boolean.TRUE);
}
return bdHolder;
}
内容来源于网络,如有侵权,请联系作者删除!