Tuesday, March 1, 2011

Spring – Properties dependency checking


Spring – Properties dependency checking

In Spring framework, you can make sure all the required properties have been set in bean by using properties dependency checking feature.

Dependency checking modes

In Spring, 4 dependency checking modes are supported:
  • none – No dependency checking.
  • simple – If any properties of primitive type (int, long,double…) and collection types (map, list..) have not been set, UnsatisfiedDependencyException will be thrown.
  • objects – If any properties of object type have not been set, UnsatisfiedDependencyException will be thrown.
  • all – If any properties of any type have not been set, an UnsatisfiedDependencyException
    will be thrown.

No comments:

Post a Comment