public class

BeanDefinitionBuilder

extends Object
java.lang.Object
   ↳ org.springframework.beans.factory.support.BeanDefinitionBuilder

Class Overview

Programmatic means of constructing BeanDefinitions using the builder pattern. Intended primarily for use when implementing Spring 2.0 NamespaceHandlers.

Summary

Public Methods
BeanDefinitionBuilder addConstructorArg(Object value)
This method is deprecated. since Spring 2.5, in favor of addConstructorArgValue(Object)
BeanDefinitionBuilder addConstructorArgReference(String beanName)
Add a reference to a named bean as a constructor arg.
BeanDefinitionBuilder addConstructorArgValue(Object value)
Add an indexed constructor arg value.
BeanDefinitionBuilder addDependsOn(String beanName)
Append the specified bean name to the list of beans that this definition depends on.
BeanDefinitionBuilder addPropertyReference(String name, String beanName)
Add a reference to the specified bean name under the property specified.
BeanDefinitionBuilder addPropertyValue(String name, Object value)
Add the supplied property value under the given name.
static BeanDefinitionBuilder childBeanDefinition(String parentName)
Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.
static BeanDefinitionBuilder genericBeanDefinition(String beanClassName)
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
static BeanDefinitionBuilder genericBeanDefinition()
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
static BeanDefinitionBuilder genericBeanDefinition(Class beanClass)
Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.
AbstractBeanDefinition getBeanDefinition()
Validate and return the created BeanDefinition object.
AbstractBeanDefinition getRawBeanDefinition()
Return the current BeanDefinition object in its raw (unvalidated) form.
static BeanDefinitionBuilder rootBeanDefinition(String beanClassName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder rootBeanDefinition(Class beanClass, String factoryMethodName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder rootBeanDefinition(String beanClassName, String factoryMethodName)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
static BeanDefinitionBuilder rootBeanDefinition(Class beanClass)
Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.
BeanDefinitionBuilder setAbstract(boolean flag)
Set whether or not this definition is abstract.
BeanDefinitionBuilder setAutowireMode(int autowireMode)
Set the autowire mode for this definition.
BeanDefinitionBuilder setDependencyCheck(int dependencyCheck)
Set the depency check mode for this definition.
BeanDefinitionBuilder setDestroyMethodName(String methodName)
Set the destroy method for this definition.
BeanDefinitionBuilder setFactoryBean(String factoryBean, String factoryMethod)
This method is deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
BeanDefinitionBuilder setFactoryMethod(String factoryMethod)
Set the name of the factory method to use for this definition.
BeanDefinitionBuilder setInitMethodName(String methodName)
Set the init method for this definition.
BeanDefinitionBuilder setLazyInit(boolean lazy)
Set whether beans for this definition should be lazily initialized or not.
BeanDefinitionBuilder setParentName(String parentName)
Set the name of the parent definition of this bean definition.
BeanDefinitionBuilder setResourceDescription(String resourceDescription)
This method is deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
BeanDefinitionBuilder setRole(int role)
Set the role of this definition.
BeanDefinitionBuilder setScope(String scope)
Set the scope of this definition.
BeanDefinitionBuilder setSingleton(boolean singleton)
This method is deprecated. since Spring 2.5, in favor of setScope(String)
BeanDefinitionBuilder setSource(Object source)
This method is deprecated. since Spring 2.5, in favor of preparing this on the raw BeanDefinition object
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public BeanDefinitionBuilder addConstructorArg (Object value)

Also: SpringBeans

This method is deprecated.
since Spring 2.5, in favor of addConstructorArgValue(Object)

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

public BeanDefinitionBuilder addConstructorArgReference (String beanName)

Also: SpringBeans

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

public BeanDefinitionBuilder addConstructorArgValue (Object value)

Also: SpringBeans

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

public BeanDefinitionBuilder addDependsOn (String beanName)

Also: SpringBeans

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

public BeanDefinitionBuilder addPropertyReference (String name, String beanName)

Also: SpringBeans

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

Parameters
name the name of the property to add the reference to
beanName the name of the bean being referenced

public BeanDefinitionBuilder addPropertyValue (String name, Object value)

Also: SpringBeans

Add the supplied property value under the given name.

public static BeanDefinitionBuilder childBeanDefinition (String parentName)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition.

Parameters
parentName the name of the parent bean

public static BeanDefinitionBuilder genericBeanDefinition (String beanClassName)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

Parameters
beanClassName the class name for the bean that the definition is being created for

public static BeanDefinitionBuilder genericBeanDefinition ()

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

public static BeanDefinitionBuilder genericBeanDefinition (Class beanClass)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a GenericBeanDefinition.

Parameters
beanClass the Class of the bean that the definition is being created for

public AbstractBeanDefinition getBeanDefinition ()

Also: SpringBeans

Validate and return the created BeanDefinition object.

public AbstractBeanDefinition getRawBeanDefinition ()

Also: SpringBeans

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

public static BeanDefinitionBuilder rootBeanDefinition (String beanClassName)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters
beanClassName the class name for the bean that the definition is being created for

public static BeanDefinitionBuilder rootBeanDefinition (Class beanClass, String factoryMethodName)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters
beanClass the Class of the bean that the definition is being created for
factoryMethodName the name of the method to use to construct the bean instance

public static BeanDefinitionBuilder rootBeanDefinition (String beanClassName, String factoryMethodName)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters
beanClassName the class name for the bean that the definition is being created for
factoryMethodName the name of the method to use to construct the bean instance

public static BeanDefinitionBuilder rootBeanDefinition (Class beanClass)

Also: SpringBeans

Create a new BeanDefinitionBuilder used to construct a RootBeanDefinition.

Parameters
beanClass the Class of the bean that the definition is being created for

public BeanDefinitionBuilder setAbstract (boolean flag)

Also: SpringBeans

Set whether or not this definition is abstract.

public BeanDefinitionBuilder setAutowireMode (int autowireMode)

Also: SpringBeans

Set the autowire mode for this definition.

public BeanDefinitionBuilder setDependencyCheck (int dependencyCheck)

Also: SpringBeans

Set the depency check mode for this definition.

public BeanDefinitionBuilder setDestroyMethodName (String methodName)

Also: SpringBeans

Set the destroy method for this definition.

public BeanDefinitionBuilder setFactoryBean (String factoryBean, String factoryMethod)

Also: SpringBeans

This method is deprecated.
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the name of the factory bean to use for this definition.

public BeanDefinitionBuilder setFactoryMethod (String factoryMethod)

Also: SpringBeans

Set the name of the factory method to use for this definition.

public BeanDefinitionBuilder setInitMethodName (String methodName)

Also: SpringBeans

Set the init method for this definition.

public BeanDefinitionBuilder setLazyInit (boolean lazy)

Also: SpringBeans

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

public BeanDefinitionBuilder setParentName (String parentName)

Also: SpringBeans

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

public BeanDefinitionBuilder setResourceDescription (String resourceDescription)

Also: SpringBeans

This method is deprecated.
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the description associated with this definition.

public BeanDefinitionBuilder setRole (int role)

Also: SpringBeans

Set the role of this definition.

public BeanDefinitionBuilder setScope (String scope)

Also: SpringBeans

Set the scope of this definition.

public BeanDefinitionBuilder setSingleton (boolean singleton)

Also: SpringBeans

This method is deprecated.
since Spring 2.5, in favor of setScope(String)

Set whether or not this definition describes a singleton bean, as alternative to setScope(String).

public BeanDefinitionBuilder setSource (Object source)

Also: SpringBeans

This method is deprecated.
since Spring 2.5, in favor of preparing this on the raw BeanDefinition object

Set the source of this definition.