spring-framework / org.springframework.beans.factory.support / BeanDefinitionBuilder

BeanDefinitionBuilder

open class BeanDefinitionBuilder

Programmatic means of constructing org.springframework.beans.factory.config.BeanDefinition using the builder pattern. Intended primarily for use when implementing Spring 2.0 org.springframework.beans.factory.xml.NamespaceHandler.

Author
Rod Johnson

Author
Rob Harrop

Author
Juergen Hoeller

Since
2.0

Functions

addConstructorArgReference

open fun addConstructorArgReference(beanName: String): BeanDefinitionBuilder

Add a reference to a named bean as a constructor arg.

addConstructorArgValue

open fun addConstructorArgValue(value: Any): BeanDefinitionBuilder

Add an indexed constructor arg value. The current index is tracked internally and all additions are at the present point.

addDependsOn

open fun addDependsOn(beanName: String): BeanDefinitionBuilder

Append the specified bean name to the list of beans that this definition depends on.

addPropertyReference

open fun addPropertyReference(name: String, beanName: String): BeanDefinitionBuilder

Add a reference to the specified bean name under the property specified.

addPropertyValue

open fun addPropertyValue(name: String, value: Any): BeanDefinitionBuilder

Add the supplied property value under the given name.

applyCustomizers

open fun applyCustomizers(vararg customizers: BeanDefinitionCustomizer): BeanDefinitionBuilder

Apply the given customizers to the underlying bean definition.

childBeanDefinition

open static fun childBeanDefinition(parentName: String): BeanDefinitionBuilder

Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.

genericBeanDefinition

open static fun genericBeanDefinition(): BeanDefinitionBuilder
open static fun genericBeanDefinition(beanClassName: String): BeanDefinitionBuilder
open static fun genericBeanDefinition(beanClass: Class<*>): BeanDefinitionBuilder
open static fun <T : Any> genericBeanDefinition(beanClass: Class<T>, instanceSupplier: Supplier<T>): BeanDefinitionBuilder

Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

getBeanDefinition

open fun getBeanDefinition(): AbstractBeanDefinition

Validate and return the created BeanDefinition object.

getRawBeanDefinition

open fun getRawBeanDefinition(): AbstractBeanDefinition

Return the current BeanDefinition object in its raw (unvalidated) form.

rootBeanDefinition

open static fun rootBeanDefinition(beanClassName: String): BeanDefinitionBuilder
open static fun rootBeanDefinition(beanClassName: String, factoryMethodName: String): BeanDefinitionBuilder
open static fun rootBeanDefinition(beanClass: Class<*>): BeanDefinitionBuilder
open static fun rootBeanDefinition(beanClass: Class<*>, factoryMethodName: String): BeanDefinitionBuilder

Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

setAbstract

open fun setAbstract(flag: Boolean): BeanDefinitionBuilder

Set whether or not this definition is abstract.

setAutowireMode

open fun setAutowireMode(autowireMode: Int): BeanDefinitionBuilder

Set the autowire mode for this definition.

setDependencyCheck

open fun setDependencyCheck(dependencyCheck: Int): BeanDefinitionBuilder

Set the depency check mode for this definition.

setDestroyMethodName

open fun setDestroyMethodName(methodName: String): BeanDefinitionBuilder

Set the destroy method for this definition.

setFactoryMethod

open fun setFactoryMethod(factoryMethod: String): BeanDefinitionBuilder

Set the name of a static factory method to use for this definition, to be called on this bean's class.

setFactoryMethodOnBean

open fun setFactoryMethodOnBean(factoryMethod: String, factoryBean: String): BeanDefinitionBuilder

Set the name of a non-static factory method to use for this definition, including the bean name of the factory instance to call the method on.

setInitMethodName

open fun setInitMethodName(methodName: String): BeanDefinitionBuilder

Set the init method for this definition.

setLazyInit

open fun setLazyInit(lazy: Boolean): BeanDefinitionBuilder

Set whether beans for this definition should be lazily initialized or not.

setParentName

open fun setParentName(parentName: String): BeanDefinitionBuilder

Set the name of the parent definition of this bean definition.

setRole

open fun setRole(role: Int): BeanDefinitionBuilder

Set the role of this definition.

setScope

open fun setScope(scope: String): BeanDefinitionBuilder

Set the scope of this definition.