org.springframework.beans.factory.support
Class RootBeanDefinition

java.lang.Object
  extended byorg.springframework.beans.factory.support.AbstractBeanDefinition
      extended byorg.springframework.beans.factory.support.RootBeanDefinition
All Implemented Interfaces:
BeanDefinition

public class RootBeanDefinition
extends AbstractBeanDefinition

Root bean definitions have a class plus optionally constructor argument values and property values. This is the most common type of bean definition.

Note that root bean definitions do not have to specify a bean class: This can be useful for deriving childs from, each with its own bean class but inheriting common property values and other settings.

Author:
Rod Johnson, Juergen Hoeller
See Also:
AutowireCapableBeanFactory

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
RootBeanDefinition(java.lang.Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
          Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
RootBeanDefinition(java.lang.Class beanClass, int autowireMode)
          Create a new RootBeanDefinition for a singleton, using the given autowire mode.
RootBeanDefinition(java.lang.Class beanClass, int autowireMode, boolean dependencyCheck)
          Create a new RootBeanDefinition for a singleton, using the given autowire mode.
RootBeanDefinition(java.lang.Class beanClass, MutablePropertyValues pvs)
          Create a new RootBeanDefinition for a singleton, providing property values.
RootBeanDefinition(java.lang.Class beanClass, MutablePropertyValues pvs, boolean singleton)
          Create a new RootBeanDefinition with the given singleton status, providing property values.
RootBeanDefinition(RootBeanDefinition other)
          Deep copy constructor.
RootBeanDefinition(java.lang.String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
          Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.
 
Method Summary
 java.lang.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, isLazyInit, isSingleton, overrideFrom, setAbstract, setAutowireMode, setBeanClass, setBeanClassName, setConstructorArgumentValues, setDependencyCheck, setDependsOn, setDestroyMethodName, 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

RootBeanDefinition

public RootBeanDefinition(java.lang.Class beanClass,
                          int autowireMode)
Create a new RootBeanDefinition for a singleton, using the given autowire mode.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface

RootBeanDefinition

public RootBeanDefinition(java.lang.Class beanClass,
                          int autowireMode,
                          boolean dependencyCheck)
Create a new RootBeanDefinition for a singleton, using the given autowire mode.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)

RootBeanDefinition

public RootBeanDefinition(java.lang.Class beanClass,
                          MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing property values.

Parameters:
beanClass - the class of the bean to instantiate
pvs - the property values to apply

RootBeanDefinition

public RootBeanDefinition(java.lang.Class beanClass,
                          MutablePropertyValues pvs,
                          boolean singleton)
Create a new RootBeanDefinition with the given singleton status, providing property values.

Parameters:
beanClass - the class of the bean to instantiate
pvs - the property values to apply
singleton - the singleton status of the bean

RootBeanDefinition

public RootBeanDefinition(java.lang.Class beanClass,
                          ConstructorArgumentValues cargs,
                          MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Parameters:
beanClass - the class of the bean to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

RootBeanDefinition

public RootBeanDefinition(java.lang.String beanClassName,
                          ConstructorArgumentValues cargs,
                          MutablePropertyValues pvs)
Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values. Takes a bean class name to avoid eager loading of the bean class.

Parameters:
beanClassName - the name of the class to instantiate
cargs - the constructor argument values to apply
pvs - the property values to apply

RootBeanDefinition

public RootBeanDefinition(RootBeanDefinition other)
Deep copy constructor.

Method Detail

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 java.lang.String toString()


Copyright (C) 2003-2004 The Spring Framework Project.