|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.AttributeAccessorSupport org.springframework.beans.BeanMetadataAttributeAccessor org.springframework.beans.factory.support.AbstractBeanDefinition org.springframework.beans.factory.support.RootBeanDefinition
public class RootBeanDefinition
A root bean definition represents the merged bean definition that backs
a specific bean in a Spring BeanFactory at runtime. It might have been created
from multiple original bean definitions that inherit from each other,
typically registered as GenericBeanDefinitions
.
A root bean definition is essentially the 'unified' bean definition view at runtime.
Root bean definitions may also be used for registering individual bean definitions
in the configuration phase. However, since Spring 2.5, the preferred way to register
bean definitions programmatically is the GenericBeanDefinition
class.
GenericBeanDefinition has the advantage that it allows to dynamically define
parent dependencies, not 'hard-coding' the role as a root bean definition.
GenericBeanDefinition
,
ChildBeanDefinition
,
Serialized FormField Summary |
---|
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition |
---|
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, DEPENDENCY_CHECK_ALL, DEPENDENCY_CHECK_NONE, DEPENDENCY_CHECK_OBJECTS, DEPENDENCY_CHECK_SIMPLE, INFER_METHOD, SCOPE_DEFAULT |
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition |
---|
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON |
Constructor Summary | |
---|---|
RootBeanDefinition()
Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods. |
|
RootBeanDefinition(Class beanClass)
Create a new RootBeanDefinition for a singleton. |
|
RootBeanDefinition(Class beanClass,
boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String) |
|
RootBeanDefinition(Class beanClass,
ConstructorArgumentValues cargs,
MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values. |
|
RootBeanDefinition(Class beanClass,
int autowireMode)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.setAutowireMode(int) usage |
|
RootBeanDefinition(Class beanClass,
int autowireMode,
boolean dependencyCheck)
Create a new RootBeanDefinition for a singleton, using the given autowire mode. |
|
RootBeanDefinition(Class beanClass,
MutablePropertyValues pvs)
Deprecated. as of Spring 3.0, in favor of AbstractBeanDefinition.getPropertyValues() usage |
|
RootBeanDefinition(Class beanClass,
MutablePropertyValues pvs,
boolean singleton)
Deprecated. since Spring 2.5, in favor of AbstractBeanDefinition.setScope(java.lang.String) |
|
RootBeanDefinition(RootBeanDefinition original)
Create a new RootBeanDefinition as deep copy of the given bean definition. |
|
RootBeanDefinition(String beanClassName)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values. |
|
RootBeanDefinition(String beanClassName,
ConstructorArgumentValues cargs,
MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values. |
Method Summary | |
---|---|
RootBeanDefinition |
cloneBeanDefinition()
Clone this bean definition. |
boolean |
equals(Object other)
|
BeanDefinitionHolder |
getDecoratedDefinition()
|
String |
getParentName()
Return the name of the parent definition of this bean definition, if any. |
Method |
getResolvedFactoryMethod()
Return the resolved factory method as a Java Method object, if available. |
boolean |
isExternallyManagedConfigMember(Member configMember)
|
boolean |
isExternallyManagedDestroyMethod(String destroyMethod)
|
boolean |
isExternallyManagedInitMethod(String initMethod)
|
boolean |
isFactoryMethod(Method candidate)
Check whether the given candidate qualifies as a factory method. |
void |
registerExternallyManagedConfigMember(Member configMember)
|
void |
registerExternallyManagedDestroyMethod(String destroyMethod)
|
void |
registerExternallyManagedInitMethod(String initMethod)
|
void |
setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)
|
void |
setParentName(String parentName)
Set the name of the parent definition of this bean definition, if any. |
void |
setUniqueFactoryMethodName(String name)
Specify a factory method name that refers to a non-overloaded method. |
String |
toString()
|
Methods inherited from class org.springframework.beans.BeanMetadataAttributeAccessor |
---|
addMetadataAttribute, getAttribute, getMetadataAttribute, getSource, removeAttribute, setAttribute, setSource |
Methods inherited from class org.springframework.core.AttributeAccessorSupport |
---|
attributeNames, copyAttributesFrom, hasAttribute |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.core.AttributeAccessor |
---|
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute |
Methods inherited from interface org.springframework.beans.BeanMetadataElement |
---|
getSource |
Constructor Detail |
---|
public RootBeanDefinition()
AbstractBeanDefinition.setBeanClass(java.lang.Class>)
,
AbstractBeanDefinition.setBeanClassName(java.lang.String)
,
AbstractBeanDefinition.setScope(java.lang.String)
,
AbstractBeanDefinition.setAutowireMode(int)
,
AbstractBeanDefinition.setDependencyCheck(int)
,
AbstractBeanDefinition.setConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues)
,
AbstractBeanDefinition.setPropertyValues(org.springframework.beans.MutablePropertyValues)
public RootBeanDefinition(Class beanClass)
beanClass
- the class of the bean to instantiate@Deprecated public RootBeanDefinition(Class beanClass, boolean singleton)
AbstractBeanDefinition.setScope(java.lang.String)
beanClass
- the class of the bean to instantiatesingleton
- the singleton status of the bean@Deprecated public RootBeanDefinition(Class beanClass, int autowireMode)
AbstractBeanDefinition.setAutowireMode(int)
usage
beanClass
- the class of the bean to instantiateautowireMode
- by name or type, using the constants in this interfacepublic RootBeanDefinition(Class beanClass, int autowireMode, boolean dependencyCheck)
beanClass
- the class of the bean to instantiateautowireMode
- by name or type, using the constants in this interfacedependencyCheck
- whether to perform a dependency check for objects
(not applicable to autowiring a constructor, thus ignored there)@Deprecated public RootBeanDefinition(Class beanClass, MutablePropertyValues pvs)
AbstractBeanDefinition.getPropertyValues()
usage
beanClass
- the class of the bean to instantiatepvs
- the property values to apply@Deprecated public RootBeanDefinition(Class beanClass, MutablePropertyValues pvs, boolean singleton)
AbstractBeanDefinition.setScope(java.lang.String)
beanClass
- the class of the bean to instantiatepvs
- the property values to applysingleton
- the singleton status of the beanpublic RootBeanDefinition(Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
beanClass
- the class of the bean to instantiatecargs
- the constructor argument values to applypvs
- the property values to applypublic RootBeanDefinition(String beanClassName)
Takes a bean class name to avoid eager loading of the bean class.
beanClassName
- the name of the class to instantiatepublic RootBeanDefinition(String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
Takes a bean class name to avoid eager loading of the bean class.
beanClassName
- the name of the class to instantiatecargs
- the constructor argument values to applypvs
- the property values to applypublic RootBeanDefinition(RootBeanDefinition original)
original
- the original bean definition to copy fromMethod Detail |
---|
public String getParentName()
BeanDefinition
public void setParentName(String parentName)
BeanDefinition
public void setUniqueFactoryMethodName(String name)
public boolean isFactoryMethod(Method candidate)
public Method getResolvedFactoryMethod()
null
if not found or not resolved yetpublic void registerExternallyManagedConfigMember(Member configMember)
public boolean isExternallyManagedConfigMember(Member configMember)
public void registerExternallyManagedInitMethod(String initMethod)
public boolean isExternallyManagedInitMethod(String initMethod)
public void registerExternallyManagedDestroyMethod(String destroyMethod)
public boolean isExternallyManagedDestroyMethod(String destroyMethod)
public void setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)
public BeanDefinitionHolder getDecoratedDefinition()
public RootBeanDefinition cloneBeanDefinition()
AbstractBeanDefinition
cloneBeanDefinition
in class AbstractBeanDefinition
public boolean equals(Object other)
equals
in class AbstractBeanDefinition
public String toString()
toString
in class AbstractBeanDefinition
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |