|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.support.BeanDefinitionBuilder
public class BeanDefinitionBuilder
Programmatic means of constructing
BeanDefinitions
using the builder pattern. Intended primarily for use when implementing Spring 2.0
NamespaceHandlers
.
Method Summary | |
---|---|
BeanDefinitionBuilder |
addConstructorArg(Object value)
Add an indexed constructor arg value. |
BeanDefinitionBuilder |
addConstructorArgReference(String beanName)
Add a reference to a named bean as a constructor arg. |
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 parentBeanName)
Create a new BeanDefinitionBuilder used to construct a ChildBeanDefinition . |
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)
Set the name of the factory bean to use for this definition. |
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 |
setResourceDescription(String resourceDescription)
Set the description associated with this definition. |
BeanDefinitionBuilder |
setRole(int role)
Set the role of this definition. |
BeanDefinitionBuilder |
setScope(String scope)
Set the scope of this definition. |
BeanDefinitionBuilder |
setSingleton(boolean singleton)
Set whether or not this definition describes a singleton bean, as alternative to setScope . |
BeanDefinitionBuilder |
setSource(Object source)
Set the source of this definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public 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 parentBeanName)
BeanDefinitionBuilder
used to construct a ChildBeanDefinition
.
parentBeanName
- the name of the parent beanpublic AbstractBeanDefinition getRawBeanDefinition()
getBeanDefinition()
public AbstractBeanDefinition getBeanDefinition()
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 addConstructorArg(Object value)
public BeanDefinitionBuilder addConstructorArgReference(String beanName)
addConstructorArg(Object)
public BeanDefinitionBuilder setFactoryMethod(String factoryMethod)
public BeanDefinitionBuilder setFactoryBean(String factoryBean, String factoryMethod)
public BeanDefinitionBuilder setScope(String scope)
public BeanDefinitionBuilder setSingleton(boolean singleton)
setScope
.
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 setDestroyMethodName(String methodName)
public BeanDefinitionBuilder setInitMethodName(String methodName)
public BeanDefinitionBuilder setResourceDescription(String resourceDescription)
public BeanDefinitionBuilder addDependsOn(String beanName)
public BeanDefinitionBuilder setSource(Object source)
public BeanDefinitionBuilder setRole(int role)
AbstractBeanDefinition.setRole(int)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |