Save This Page
Home » spring-framework-2.5.4 » org.springframework » beans » factory » support » [javadoc | source]
org.springframework.beans.factory.support
public class: ChildBeanDefinition [javadoc | source]
java.lang.Object
   org.springframework.core.AttributeAccessorSupport
      org.springframework.beans.BeanMetadataAttributeAccessor
         org.springframework.beans.factory.support.AbstractBeanDefinition
            org.springframework.beans.factory.support.ChildBeanDefinition

All Implemented Interfaces:
    Cloneable, BeanDefinition, BeanMetadataElement, AttributeAccessor, Serializable

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 GenericBeanDefinition#setParentName method. This effectively supersedes the ChildBeanDefinition class for most use cases.

Fields inherited from org.springframework.beans.factory.support.AbstractBeanDefinition:
AUTOWIRE_NO,  AUTOWIRE_BY_NAME,  AUTOWIRE_BY_TYPE,  AUTOWIRE_CONSTRUCTOR,  AUTOWIRE_AUTODETECT,  DEPENDENCY_CHECK_NONE,  DEPENDENCY_CHECK_OBJECTS,  DEPENDENCY_CHECK_SIMPLE,  DEPENDENCY_CHECK_ALL
Constructor:
 public ChildBeanDefinition(String parentName) 
    Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.
 public ChildBeanDefinition(ChildBeanDefinition original) 
    Create a new ChildBeanDefinition as deep copy of the given bean definition.
    Parameters:
    original - the original bean definition to copy from
 public ChildBeanDefinition(String parentName,
    MutablePropertyValues pvs) 
    Create a new ChildBeanDefinition for the given parent.
    Parameters:
    parentName - the name of the parent bean
    pvs - the additional property values of the child
 public ChildBeanDefinition(String parentName,
    ConstructorArgumentValues cargs,
    MutablePropertyValues pvs) 
    Create a new ChildBeanDefinition for the given parent.
    Parameters:
    parentName - the name of the parent bean
    cargs - the constructor argument values to apply
    pvs - the additional property values of the child
 public ChildBeanDefinition(String parentName,
    Class beanClass,
    ConstructorArgumentValues cargs,
    MutablePropertyValues pvs) 
    Create a new ChildBeanDefinition for the given parent, providing constructor arguments and property values.
    Parameters:
    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
 public ChildBeanDefinition(String parentName,
    String beanClassName,
    ConstructorArgumentValues cargs,
    MutablePropertyValues pvs) 
    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.
    Parameters:
    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
Method from org.springframework.beans.factory.support.ChildBeanDefinition Summary:
cloneBeanDefinition,   equals,   getParentName,   hashCode,   setParentName,   toString,   validate
Methods from org.springframework.beans.factory.support.AbstractBeanDefinition:
addQualifier,   applyDefaults,   clone,   cloneBeanDefinition,   copyQualifiersFrom,   equals,   getAutowireMode,   getBeanClass,   getBeanClassName,   getConstructorArgumentValues,   getDependencyCheck,   getDependsOn,   getDestroyMethodName,   getFactoryBeanName,   getFactoryMethodName,   getInitMethodName,   getMethodOverrides,   getOriginatingBeanDefinition,   getPropertyValues,   getQualifier,   getQualifiers,   getResolvedAutowireMode,   getResource,   getResourceDescription,   getRole,   getScope,   hasBeanClass,   hasConstructorArgumentValues,   hasQualifier,   hashCode,   isAbstract,   isAutowireCandidate,   isEnforceDestroyMethod,   isEnforceInitMethod,   isLazyInit,   isPrimary,   isPrototype,   isSingleton,   isSynthetic,   overrideFrom,   overrideFrom,   prepareMethodOverride,   prepareMethodOverrides,   resolveBeanClass,   setAbstract,   setAutowireCandidate,   setAutowireMode,   setBeanClass,   setBeanClassName,   setConstructorArgumentValues,   setDependencyCheck,   setDependsOn,   setDestroyMethodName,   setEnforceDestroyMethod,   setEnforceInitMethod,   setFactoryBeanName,   setFactoryMethodName,   setInitMethodName,   setLazyInit,   setMethodOverrides,   setOriginatingBeanDefinition,   setPrimary,   setPropertyValues,   setResource,   setResourceDescription,   setRole,   setScope,   setSingleton,   setSynthetic,   toString,   validate
Methods from org.springframework.beans.BeanMetadataAttributeAccessor:
addMetadataAttribute,   getAttribute,   getMetadataAttribute,   getSource,   removeAttribute,   setAttribute,   setSource
Methods from org.springframework.core.AttributeAccessorSupport:
attributeNames,   copyAttributesFrom,   equals,   getAttribute,   hasAttribute,   hashCode,   removeAttribute,   setAttribute
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.beans.factory.support.ChildBeanDefinition Detail:
 public AbstractBeanDefinition cloneBeanDefinition() 
 public boolean equals(Object other) 
 public String getParentName() 
 public int hashCode() 
 public  void setParentName(String parentName) 
 public String toString() 
 public  void validate() throws BeanDefinitionValidationException