Package org.citrusframework.config.util
Class BeanDefinitionParserUtils
java.lang.Object
org.citrusframework.config.util.BeanDefinitionParserUtils
Provides shared utility methods for bean definition parsing.
- Author:
- Christoph Deppisch
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddConstructorArgReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference) Sets the property reference on bean definition in case reference is set properly.static org.springframework.beans.factory.config.BeanDefinitionHolderregisterBean(String beanId, Class<?> beanClass, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents) Creates new bean definition from bean class and registers new bean in parser registry.static org.springframework.beans.factory.config.BeanDefinitionHolderregisterBean(String beanId, org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents) Registers bean definition in parser registry and returns bean definition holder.static voidsetConstructorArgValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue) Sets the property value on bean definition as constructor argument in case value is not null.static voidsetPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName) Sets the property reference on bean definition in case reference is set properly.static voidsetPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName, String defaultValue) Sets the property reference on bean definition.static voidsetPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue, String propertyName) Sets the property value on bean definition in case value is set properly.
-
Method Details
-
setPropertyValue
public static void setPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue, String propertyName) Sets the property value on bean definition in case value is set properly.- Parameters:
builder- the bean definition builder to be configuredpropertyValue- the property valuepropertyName- the name of the property
-
setConstructorArgValue
public static void setConstructorArgValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue) Sets the property value on bean definition as constructor argument in case value is not null.- Parameters:
builder- the bean definition to be configuredpropertyValue- the property value
-
setPropertyReference
public static void setPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName) Sets the property reference on bean definition in case reference is set properly.- Parameters:
builder- the bean definition builder to be configuredbeanReference- bean reference to populate the propertypropertyName- the name of the property
-
addConstructorArgReference
public static void addConstructorArgReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference) Sets the property reference on bean definition in case reference is set properly.- Parameters:
builder- the bean definition builder to be configuredbeanReference- bean reference to add as constructor arg
-
setPropertyReference
public static void setPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName, String defaultValue) Sets the property reference on bean definition. In case reference is not available a default value is set.- Parameters:
builder-beanReference-propertyName-defaultValue-
-
registerBean
public static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents) Creates new bean definition from bean class and registers new bean in parser registry. Returns bean definition holder.- Parameters:
beanId-beanClass-parserContext-shouldFireEvents-
-
registerBean
public static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean(String beanId, org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents) Registers bean definition in parser registry and returns bean definition holder.- Parameters:
beanId-beanDefinition-parserContext-shouldFireEvents-- Returns:
-