4 dependent check supported modes:
- None – does not rely on check, which is the default mode.
- simple– if the base type (int, long,double ...) and collection type (map, list..) Any of the properties are not set, Unsatisfieddependencyexception will be thrown.
- objects– if any property of the object type is not set, Unsatisfieddependencyexception will be thrown.
- all– if any of the properties of any type are not set, Unsatisfieddependencyexception will be thrown.
Note: The default mode is None
None
<bean id= "obj" class= "Com.xuzhiwen.spring9.Object1" dependency-check= "None"> <property name= "Name" value= "Tom" /></bean>
Simple
<bean id= "obj" class= "Com.xuzhiwen.spring9.Object1" dependency-check= "simple"> <property Name = "name" value= "Tom" /></bean>
Objects
<bean id= "obj" class= "Com.xuzhiwen.spring9.Object1" dependency-check= "Objects"> <property Name = "name" value= "Tom" /></bean>
All
<bean id= "obj" class= "Com.xuzhiwen.spring9.Object1" dependency-check= "All"> <property name= " Name "value=" Tom " /></bean>
Global Default Dependency check:
<beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance " xmlns:p=" http://www.springframework.org/schema/p " xsi:schemalocation = "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-2.5.xsd" default-dependency-check=" All ">
</beans>
Dependency Checking in spring