For object provider, here is the java doc: *Type Parameters:*T - *Parameters:*objectType - the expected object type annotationProvider - provides access to annotations (typically, the field or parameter to which an injection-related annotation is attached); annotations on the field or parameter may also be used when resolving the desired object locator - locator for the *context* in which the provider is being used * Returns:*the requested object, or null if this object provider can not supply an object The problem is here: if my object provider really want to inject null to object, how could I do? As I understand, if I return null, the IOC will try to find other providers to inject it and throw exception. So I have no way to inject null to object. That does not make sense at all.
Thanks. -- Haipeng Du Salt Lake City