站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

ChildBeanDefinition (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.beans.factory.support
Class ChildBeanDefinition

java.lang.Object
  extended by org.springframework.beans.factory.support.AbstractBeanDefinition
      extended by org.springframework.beans.factory.support.ChildBeanDefinition
All Implemented Interfaces:
BeanDefinition

public class ChildBeanDefinition
extends AbstractBeanDefinition

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.

Author:
Rod Johnson, Juergen Hoeller
See Also:
RootBeanDefinition

Field 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
 
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
 String getParentName()
          Return the name of the parent definition of this bean definition.
 String toString()
           
 void validate()
          Validate this bean definition.
 
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition
getAutowireMode, getBeanClass, getBeanClassName, getConstructorArgumentValues, getDependencyCheck, getDependsOn, getDestroyMethodName, getFactoryBeanName, getFactoryMethodName, getInitMethodName, getMethodOverrides, getPropertyValues, getResolvedAutowireMode, getResourceDescription, hasBeanClass, hasConstructorArgumentValues, isAbstract, isEnforceDestroyMethod, isEnforceInitMethod, isLazyInit, isSingleton, overrideFrom, setAbstract, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDestroyMethodName, setEnforceDestroyMethod, setEnforceInitMethod, setFactoryBeanName, setFactoryMethodName, setInitMethodName, setLazyInit, setMethodOverrides, setPropertyValues, setResourceDescription, setSingleton, validateMethodOverride
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChildBeanDefinition

public ChildBeanDefinition(String parentName)
Create a new ChildBeanDefinition for the given parent, to be configured through its bean properties and configuration methods.

Parameters:
parentName - the name of the parent bean
See Also:
AbstractBeanDefinition.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)

ChildBeanDefinition

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

ChildBeanDefinition

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

ChildBeanDefinition

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

ChildBeanDefinition

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 Detail

getParentName

public String getParentName()
Return the name of the parent definition of this bean definition.


validate

public void validate()
              throws BeanDefinitionValidationException
Description copied from class: AbstractBeanDefinition
Validate this bean definition.

Overrides:
validate in class AbstractBeanDefinition
Throws:
BeanDefinitionValidationException - in case of validation failure

toString

public String toString()
Overrides:
toString in class AbstractBeanDefinition


Copyright (c) 2002-2007 The Spring Framework Project.