protected < T > Provider < T > findProvider ( Class < T > type , Annotation qualifier ) throws ProviderMissingException { String key = PokeHelper . makeProviderKey ( type , qualifier ) ; Component targetComponent = getRootComponent ( ) . componentLocator . get ( key ) ; Provider provider = null ; if ( targetComponent != null ) { provider = targetComponent . providers . get ( key ) ; } if ( provider == null ) { String msg = String . format ( "Provider(%s) cannot be found" , key ) ; throw new ProviderMissingException ( msg ) ; } else { return provider ; } }
Find the provider specified by the type and qualifier . It will look through the providers registered to this component and all its children components .