public class BeanDefinitionBuilder extends Object
BeanDefinitions
using the builder pattern. Intended primarily for use when implementing Spring 2.0
NamespaceHandlers
.Modifier and Type | Method and Description |
---|---|
BeanDefinitionBuilder |
addConstructorArg(Object value)
Deprecated.
since Spring 2.5, in favor of
addConstructorArgValue(java.lang.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()
Create a new
BeanDefinitionBuilder used to construct a GenericBeanDefinition . |
static BeanDefinitionBuilder |
genericBeanDefinition(Class beanClass)
Create a new
BeanDefinitionBuilder used to construct a GenericBeanDefinition . |
static BeanDefinitionBuilder |
genericBeanDefinition(String beanClassName)
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(Class beanClass)
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)
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 . |
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)
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)
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)
Deprecated.
since Spring 2.5, in favor of
setScope(java.lang.String) |
BeanDefinitionBuilder |
setSource(Object source)
Deprecated.
since Spring 2.5, in favor of preparing this on the
raw BeanDefinition object |
public static BeanDefinitionBuilder genericBeanDefinition()
BeanDefinitionBuilder
used to construct a GenericBeanDefinition
.public static BeanDefinitionBuilder genericBeanDefinition(Class beanClass)
BeanDefinitionBuilder
used to construct a GenericBeanDefinition
.beanClass
- the Class
of the bean that the definition is being created forpublic static BeanDefinitionBuilder genericBeanDefinition(String beanClassName)
BeanDefinitionBuilder
used to construct a GenericBeanDefinition
.beanClassName
- the class name for the bean that the definition is being created forpublic static BeanDefinitionBuilder rootBeanDefinition(Class beanClass)
BeanDefinitionBuilder
used to construct a RootBeanDefinition
.beanClass
- the Class
of the bean that the definition is being created forpublic static BeanDefinitionBuilder rootBeanDefinition(Class beanClass, String factoryMethodName)
BeanDefinitionBuilder
used to construct a RootBeanDefinition
.beanClass
- the Class
of the bean that the definition is being created forfactoryMethodName
- the name of the method to use to construct the bean instancepublic static BeanDefinitionBuilder rootBeanDefinition(String beanClassName)
BeanDefinitionBuilder
used to construct a RootBeanDefinition
.beanClassName
- the class name for the bean that the definition is being created forpublic static BeanDefinitionBuilder rootBeanDefinition(String beanClassName, String factoryMethodName)
BeanDefinitionBuilder
used to construct a RootBeanDefinition
.beanClassName
- the class name for the bean that the definition is being created forfactoryMethodName
- the name of the method to use to construct the bean instancepublic static BeanDefinitionBuilder childBeanDefinition(String parentName)
BeanDefinitionBuilder
used to construct a ChildBeanDefinition
.parentName
- the name of the parent beanpublic AbstractBeanDefinition getRawBeanDefinition()
getBeanDefinition()
public AbstractBeanDefinition getBeanDefinition()
public BeanDefinitionBuilder setParentName(String parentName)
public BeanDefinitionBuilder setFactoryMethod(String factoryMethod)
@Deprecated public BeanDefinitionBuilder setFactoryBean(String factoryBean, String factoryMethod)
raw BeanDefinition object
@Deprecated public BeanDefinitionBuilder addConstructorArg(Object value)
addConstructorArgValue(java.lang.Object)
public BeanDefinitionBuilder addConstructorArgValue(Object value)
public BeanDefinitionBuilder addConstructorArgReference(String beanName)
addConstructorArgValue(Object)
public BeanDefinitionBuilder addPropertyValue(String name, Object value)
public BeanDefinitionBuilder addPropertyReference(String name, String beanName)
name
- the name of the property to add the reference tobeanName
- the name of the bean being referencedpublic BeanDefinitionBuilder setInitMethodName(String methodName)
public BeanDefinitionBuilder setDestroyMethodName(String methodName)
public BeanDefinitionBuilder setScope(String scope)
@Deprecated public BeanDefinitionBuilder setSingleton(boolean singleton)
setScope(java.lang.String)
setScope(java.lang.String)
.public BeanDefinitionBuilder setAbstract(boolean flag)
public BeanDefinitionBuilder setLazyInit(boolean lazy)
public BeanDefinitionBuilder setAutowireMode(int autowireMode)
public BeanDefinitionBuilder setDependencyCheck(int dependencyCheck)
public BeanDefinitionBuilder addDependsOn(String beanName)
public BeanDefinitionBuilder setRole(int role)
@Deprecated public BeanDefinitionBuilder setSource(Object source)
raw BeanDefinition object
@Deprecated public BeanDefinitionBuilder setResourceDescription(String resourceDescription)
raw BeanDefinition object