|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.AttributeAccessorSupport
org.springframework.beans.factory.support.AbstractBeanDefinition
org.springframework.beans.factory.support.ChildBeanDefinition
public class ChildBeanDefinition
Bean definition for beans who inherit settings from their parent.
Will use the bean class of the parent if none specified, but can also override it. In the latter case, the child bean class must be compatible with the parent, i.e. accept the parent's property values and constructor argument values, if any.
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.
RootBeanDefinition
,
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 |
Fields inherited from interface org.springframework.beans.factory.config.BeanDefinition |
---|
ROLE_APPLICATION, ROLE_INFRASTRUCTURE, ROLE_SUPPORT, SCOPE_PROTOTYPE, SCOPE_SINGLETON |
Constructor Summary | |
---|---|
ChildBeanDefinition(String parentName)
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods. |
|
ChildBeanDefinition(String parentName,
Class beanClass,
ConstructorArgumentValues cargs,
MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values. |
|
ChildBeanDefinition(String parentName,
ConstructorArgumentValues cargs,
MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent. |
|
ChildBeanDefinition(String parentName,
MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent. |
|
ChildBeanDefinition(String parentName,
String beanClassName,
ConstructorArgumentValues cargs,
MutablePropertyValues pvs)
Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values. |
Method Summary | |
---|---|
boolean |
equals(Object other)
|
String |
getParentName()
Return the name of the parent definition of this bean definition. |
int |
hashCode()
|
String |
toString()
|
void |
validate()
Validate this bean definition. |
Methods inherited from class org.springframework.core.AttributeAccessorSupport |
---|
attributeNames, copyAttributesFrom, getAttribute, hasAttribute, removeAttribute, setAttribute |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.core.AttributeAccessor |
---|
attributeNames, getAttribute, hasAttribute, removeAttribute, setAttribute |
Constructor Detail |
---|
public ChildBeanDefinition(String parentName)
parentName
- the name of the parent beanAbstractBeanDefinition.setBeanClass(java.lang.Class)
,
AbstractBeanDefinition.setBeanClassName(java.lang.String)
,
AbstractBeanDefinition.setSingleton(boolean)
,
AbstractBeanDefinition.setAutowireMode(int)
,
AbstractBeanDefinition.setDependencyCheck(int)
,
AbstractBeanDefinition.setConstructorArgumentValues(org.springframework.beans.factory.config.ConstructorArgumentValues)
,
AbstractBeanDefinition.setPropertyValues(org.springframework.beans.MutablePropertyValues)
public ChildBeanDefinition(String parentName, MutablePropertyValues pvs)
parentName
- the name of the parent beanpvs
- the additional property values of the childpublic ChildBeanDefinition(String parentName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
parentName
- the name of the parent beancargs
- the constructor argument values to applypvs
- the additional property values of the childpublic ChildBeanDefinition(String parentName, Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
parentName
- the name of the parent beanbeanClass
- the class of the bean to instantiatecargs
- the constructor argument values to applypvs
- the property values to applypublic ChildBeanDefinition(String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
parentName
- the name of the parent beanbeanClassName
- the name of the class to instantiatecargs
- the constructor argument values to applypvs
- the property values to applyMethod Detail |
---|
public String getParentName()
public void validate() throws BeanDefinitionValidationException
AbstractBeanDefinition
validate
in class AbstractBeanDefinition
BeanDefinitionValidationException
- in case of validation failurepublic boolean equals(Object other)
equals
in class AbstractBeanDefinition
public int hashCode()
hashCode
in class AbstractBeanDefinition
public String toString()
toString
in class AbstractBeanDefinition
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |