java.lang.Object | ||||
↳ | org.springframework.core.AttributeAccessorSupport | |||
↳ | org.springframework.beans.BeanMetadataAttributeAccessor | |||
↳ | org.springframework.beans.factory.support.AbstractBeanDefinition | |||
↳ | org.springframework.beans.factory.support.ChildBeanDefinition |
Bean definition for beans which inherit settings from their parent. Child bean definitions have a fixed dependency on a parent bean definition.
A child bean definition will inherit constructor argument values, property values and method overrides from the parent, with the option to add new values. If init method, destroy method and/or static factory method are specified, they will override the corresponding parent settings. The remaining settings will always be taken from the child definition: depends on, autowire mode, dependency check, singleton, lazy init.
NOTE: Since Spring 2.5, the preferred way to register bean
definitions programmatically is the GenericBeanDefinition
class,
which allows to dynamically define parent dependencies through the
setParentName(String)
method. This effectively
supersedes the ChildBeanDefinition class for most use cases.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.beans.factory.support.AbstractBeanDefinition
| |||||||||||
From interface
org.springframework.beans.factory.config.BeanDefinition
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new ChildBeanDefinition for the given parent, to be
configured through its bean properties and configuration methods.
| |||||||||||
Create a new ChildBeanDefinition for the given parent.
| |||||||||||
Create a new ChildBeanDefinition for the given parent.
| |||||||||||
Create a new ChildBeanDefinition for the given parent,
providing constructor arguments and property values.
| |||||||||||
Create a new ChildBeanDefinition for the given parent,
providing constructor arguments and property values.
| |||||||||||
Create a new ChildBeanDefinition as deep copy of the given
bean definition.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clone this bean definition.
| |||||||||||
Validate this bean definition.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.beans.factory.support.AbstractBeanDefinition
| |||||||||||
From class
org.springframework.beans.BeanMetadataAttributeAccessor
| |||||||||||
From class
org.springframework.core.AttributeAccessorSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.BeanMetadataElement
| |||||||||||
From interface
org.springframework.beans.factory.config.BeanDefinition
| |||||||||||
From interface
org.springframework.core.AttributeAccessor
|
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.
parentName | the name of the parent bean |
---|
Create a new ChildBeanDefinition for the given parent.
parentName | the name of the parent bean |
---|---|
pvs | the additional property values of the child |
Create a new ChildBeanDefinition for the given parent.
parentName | the name of the parent bean |
---|---|
cargs | the constructor argument values to apply |
pvs | the additional property values of the child |
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
parentName | the name of the parent bean |
---|---|
beanClass | the class of the bean to instantiate |
cargs | the constructor argument values to apply |
pvs | the property values to apply |
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values. Takes a bean class name to avoid eager loading of the bean class.
parentName | the name of the parent bean |
---|---|
beanClassName | the name of the class to instantiate |
cargs | the constructor argument values to apply |
pvs | the property values to apply |
Create a new ChildBeanDefinition as deep copy of the given bean definition.
original | the original bean definition to copy from |
---|
Clone this bean definition. To be implemented by concrete subclasses.