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
ConstructorsConstructorDescriptionBeanComponentDefinitionBuilder(Element defaultSource, ParserContext context) Creates a newBeanComponentDefinitionBuilderusing the givenElementas default source and the givenParserContext. -
Method Summary
Modifier and TypeMethodDescriptiongetComponent(BeanDefinitionBuilder builder) Creates aBeanComponentDefinitionfrom the givenBeanDefinitionBuilder.getComponent(BeanDefinitionBuilder builder, String name) Creates aBeanComponentDefinitionfrom the givenBeanDefinitionBuilderusing the given name.getComponent(BeanDefinitionBuilder builder, String name, Object rawSource) Creates a newBeanComponentDefinitionfrom the givenBeanDefinitionBuilderusing the given name and raw source object.getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) Creates aBeanComponentDefinitionfrom the givenBeanDefinitionBuilderand inspects the backingElements id attribute for a name.
-
Constructor Details
-
BeanComponentDefinitionBuilder
Creates a newBeanComponentDefinitionBuilderusing the givenElementas default source and the givenParserContext.- Parameters:
defaultSource- must not be null.context- must not be null.
-
-
Method Details
-
getComponent
Creates aBeanComponentDefinitionfrom the givenBeanDefinitionBuilder. Will generate a bean name.- Parameters:
builder- must not be null.- Returns:
-
getComponentIdButFallback
public BeanComponentDefinition getComponentIdButFallback(BeanDefinitionBuilder builder, String fallback) Creates aBeanComponentDefinitionfrom the givenBeanDefinitionBuilderand inspects the backingElements 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 aBeanComponentDefinitionfrom the givenBeanDefinitionBuilderusing 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 newBeanComponentDefinitionfrom the givenBeanDefinitionBuilderusing the given name and raw source object.- Parameters:
builder- must not be null.name- must not be null.rawSource-- Returns:
-