|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.support.AbstractBeanDefinition org.springframework.beans.factory.support.RootBeanDefinition
Root bean definitions have a class plus optionally constructor argument values and property values. This is the most common type of bean definition.
The autowire constants match the ones defined in the AutowireCapableBeanFactory interface, adding AUTOWIRE_NO.
AutowireCapableBeanFactory
Field Summary | |
static int |
AUTOWIRE_AUTODETECT
|
static int |
AUTOWIRE_BY_NAME
|
static int |
AUTOWIRE_BY_TYPE
|
static int |
AUTOWIRE_CONSTRUCTOR
|
static int |
AUTOWIRE_NO
|
static int |
DEPENDENCY_CHECK_ALL
|
static int |
DEPENDENCY_CHECK_NONE
|
static int |
DEPENDENCY_CHECK_OBJECTS
|
static int |
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 | |
int |
getAutowireMode()
Return the autowire mode as specified in the bean definition. |
java.lang.Class |
getBeanClass()
Returns the class of the wrapped bean. |
java.lang.String |
getBeanClassName()
Returns the class name of the wrapped bean. |
ConstructorArgumentValues |
getConstructorArgumentValues()
This implementations returns null: Just RootBeanDefinitions have concrete support for constructor argument values. |
int |
getDependencyCheck()
Return the dependency check code. |
java.lang.String[] |
getDependsOn()
Return the bean names that this bean depends on. |
java.lang.String |
getDestroyMethodName()
Return the name of the destroy method. |
java.lang.String |
getInitMethodName()
Return the name of the initializer method. |
int |
getResolvedAutowireMode()
Return the resolved autowire code, (resolving AUTOWIRE_AUTODETECT to AUTOWIRE_CONSTRUCTOR or AUTOWIRE_BY_TYPE). |
boolean |
hasConstructorArgumentValues()
Return if there are constructor argument values for this bean. |
void |
setAutowireMode(int autowireMode)
Set the autowire code. |
void |
setDependencyCheck(int dependencyCheck)
Set the dependency check code. |
void |
setDependsOn(java.lang.String[] dependsOn)
Set the names of the beans that this bean depends on being initialized. |
void |
setDestroyMethodName(java.lang.String destroyMethodName)
Set the name of the destroy method. |
void |
setInitMethodName(java.lang.String initMethodName)
Set the name of the initializer method. |
java.lang.String |
toString()
|
void |
validate()
Validate this bean definition. |
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinition |
getPropertyValues, getResourceDescription, isLazyInit, isSingleton, setLazyInit, setResourceDescription, setSingleton |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int AUTOWIRE_NO
public static final int AUTOWIRE_BY_NAME
public static final int AUTOWIRE_BY_TYPE
public static final int AUTOWIRE_CONSTRUCTOR
public static final int AUTOWIRE_AUTODETECT
public static final int DEPENDENCY_CHECK_NONE
public static final int DEPENDENCY_CHECK_OBJECTS
public static final int DEPENDENCY_CHECK_SIMPLE
public static final int DEPENDENCY_CHECK_ALL
Constructor Detail |
public RootBeanDefinition(java.lang.Class beanClass, int autowireMode)
beanClass
- the class of the bean to instantiateautowireMode
- by name or type, using the constants in this interfacepublic RootBeanDefinition(java.lang.Class beanClass, int autowireMode, boolean dependencyCheck)
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)public RootBeanDefinition(java.lang.Class beanClass, MutablePropertyValues pvs)
beanClass
- the class of the bean to instantiatepvs
- the property values to applypublic RootBeanDefinition(java.lang.Class beanClass, MutablePropertyValues pvs, boolean singleton)
beanClass
- the class of the bean to instantiatepvs
- the property values to applysingleton
- the singleton status of the beanpublic RootBeanDefinition(java.lang.Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
beanClass
- the class of the bean to instantiatecargs
- the constructor argument values to applypvs
- the property values to applypublic RootBeanDefinition(java.lang.String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)
beanClassName
- the name of the class to instantiatecargs
- the constructor argument values to applypvs
- the property values to applypublic RootBeanDefinition(RootBeanDefinition other)
Method Detail |
public ConstructorArgumentValues getConstructorArgumentValues()
AbstractBeanDefinition
getConstructorArgumentValues
in interface BeanDefinition
getConstructorArgumentValues
in class AbstractBeanDefinition
public boolean hasConstructorArgumentValues()
public final java.lang.Class getBeanClass() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the bean definition does not carry
a resolved bean classpublic final java.lang.String getBeanClassName()
public void setAutowireMode(int autowireMode)
autowireMode
- the autowire to set.
Must be one of the constants defined in this class.AUTOWIRE_NO
,
AUTOWIRE_BY_NAME
,
AUTOWIRE_BY_TYPE
,
AUTOWIRE_CONSTRUCTOR
,
AUTOWIRE_AUTODETECT
public int getAutowireMode()
public int getResolvedAutowireMode()
AUTOWIRE_AUTODETECT
,
AUTOWIRE_CONSTRUCTOR
,
AUTOWIRE_BY_TYPE
public void setDependencyCheck(int dependencyCheck)
dependencyCheck
- the code to set.
Must be one of the four constants defined in this class.DEPENDENCY_CHECK_NONE
,
DEPENDENCY_CHECK_OBJECTS
,
DEPENDENCY_CHECK_SIMPLE
,
DEPENDENCY_CHECK_ALL
public int getDependencyCheck()
public void setDependsOn(java.lang.String[] dependsOn)
Note that dependencies are normally expressed through bean properties or constructor arguments. This property should just be necessary for other kinds of dependencies like statics (*ugh*) or database preparation on startup.
public java.lang.String[] getDependsOn()
public void setInitMethodName(java.lang.String initMethodName)
public java.lang.String getInitMethodName()
public void setDestroyMethodName(java.lang.String destroyMethodName)
public java.lang.String getDestroyMethodName()
public void validate() throws BeanDefinitionValidationException
AbstractBeanDefinition
validate
in class AbstractBeanDefinition
BeanDefinitionValidationException
- in case of validation failurepublic java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |