Class BeanDefinitionUtils
java.lang.Object
org.craftercms.engine.util.spring.BeanDefinitionUtils
Utility methods for handling Spring bean definition.
- Author:
- avasquez
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPropertyIfNotNull
(org.springframework.beans.factory.config.BeanDefinition definition, String propertyName, Object propertyValue) Adds the property to the bean definition if the values it not emptystatic org.springframework.beans.factory.config.BeanDefinition
createBeanDefinitionFromOriginal
(org.springframework.context.ApplicationContext applicationContext, String beanName) Creates a bean definition for the specified bean name.
-
Method Details
-
createBeanDefinitionFromOriginal
public static org.springframework.beans.factory.config.BeanDefinition createBeanDefinitionFromOriginal(org.springframework.context.ApplicationContext applicationContext, String beanName) Creates a bean definition for the specified bean name. If the parent context of the current context contains a bean definition with the same name, the definition is created as a bean copy of the parent definition. This method is useful for config parsers that want to create a bean definition from configuration but also want to retain the default properties of the original bean.- Parameters:
applicationContext
- the current application contextbeanName
-- Returns:
- the bean definition
-
addPropertyIfNotNull
public static void addPropertyIfNotNull(org.springframework.beans.factory.config.BeanDefinition definition, String propertyName, Object propertyValue) Adds the property to the bean definition if the values it not empty- Parameters:
definition
- the bean definitionpropertyName
- the property namepropertyValue
- the property value
-