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 class.
GenericBeanDefinition has the advantage that it allows to dynamically define
parent dependencies, not 'hard-coding' the role as a root bean definition.
GenericBeanDefinition
GenericBeanDefinitionChildBeanDefinitionAbstractBeanDefinition.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)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)publicRootBeanDefinition(Class beanClass, 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 applypublicRootBeanDefinition(String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) {
throw new IllegalArgumentException("Root bean cannot be changed into a child bean with parent reference");