Package org.springframework.data.config
Class BeanComponentDefinitionBuilder
java.lang.Object
org.springframework.data.config.BeanComponentDefinitionBuilder
Helper to create
BeanComponentDefinition
more easily.- Author:
- Oliver Gierke
-
Constructor Summary
ConstructorDescriptionBeanComponentDefinitionBuilder
(Element defaultSource, ParserContext context) Creates a newBeanComponentDefinitionBuilder
using the givenElement
as default source and the givenParserContext
. -
Method Summary
Modifier and TypeMethodDescriptiongetComponent
(BeanDefinitionBuilder builder) Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
.getComponent
(BeanDefinitionBuilder builder, String name) Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
using the given name.getComponent
(BeanDefinitionBuilder builder, String name, Object rawSource) Creates a newBeanComponentDefinition
from the givenBeanDefinitionBuilder
using the given name and raw source object.getComponentIdButFallback
(BeanDefinitionBuilder builder, String fallback) Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
and inspects the backingElement
s id attribute for a name.
-
Constructor Details
-
BeanComponentDefinitionBuilder
Creates a newBeanComponentDefinitionBuilder
using the givenElement
as default source and the givenParserContext
.- Parameters:
defaultSource
- must not be null.context
- must not be null.
-
-
Method Details
-
getComponent
Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
. Will generate a bean name.- Parameters:
builder
- must not be null.- Returns:
-
getComponentIdButFallback
public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
and inspects the backingElement
s id attribute for a name. It will use this one if found or the given fallback if not.- Parameters:
builder
- must not be null.fallback
- must not be null or empty.- Returns:
-
getComponent
Creates aBeanComponentDefinition
from the givenBeanDefinitionBuilder
using the given name.- Parameters:
builder
- must not be null.name
- must not be null or empty.- Returns:
-
getComponent
public BeanComponentDefinition getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) Creates a newBeanComponentDefinition
from the givenBeanDefinitionBuilder
using the given name and raw source object.- Parameters:
builder
- must not be null.name
- must not be null.rawSource
-- Returns:
-