core/src/com/google/inject/spi/ProviderLookup.java
public Provider<T> getProvider() {
    return new ProviderWithDependencies<T>() {
      @Override
      public T get() {
        Provider<T> local = delegate;
        if (local == null) {
          throw new IllegalStateException(
              "This Provider cannot be used until the Injector has been created.");
        }
        return local.get();
      }

      @Override
      public Set<Dependency<?>> getDependencies() {
        // We depend on Provider<T>, not T directly.  This is an important distinction
        // for dependency analysis tools that short-circuit on providers.
        Key<?> providerKey = getKey().ofType(Types.providerOf(getKey().getTypeLiteral().getType()));
        return ImmutableSet.<Dependency<?>>of(Dependency.get(providerKey));
      }

      @Override
      public String toString() {
        return "Provider<" + getKey().getTypeLiteral() + ">";
      }
    };
  }
public Provider<T> getProvider() {
    return new ProviderWithDependencies<T>() {
      @Override
      public T get() {
        Provider<T> local = delegate;
        if (local == null) {
          throw new IllegalStateException(
              "This Provider cannot be used until the Injector has been created.");
        }
        return local.get();
      }

      @Override
      public Set<Dependency<?>> getDependencies() {
        // We depend on Provider<T>, not T directly.  This is an important distinction
        // for dependency analysis tools that short-circuit on providers.
        Key<?> providerKey = getKey().ofType(Types.providerOf(getKey().getTypeLiteral().getType()));
        return ImmutableSet.<Dependency<?>>of(Dependency.get(providerKey));
      }

      @Override
      public String toString() {
        return "Provider<" + getKey().getTypeLiteral() + ">";
      }
    };
  }
public Provider < T > getProvider ( ) { return new ProviderWithDependencies < T > ( ) { @ Override public T get ( ) { Provider < T > local = delegate ; if ( local == null ) { throw new IllegalStateException ( "This Provider cannot be used until the Injector has been created." ) ; } return local . get ( ) ; } @ Override public Set < Dependency < ? > > getDependencies ( ) { // We depend on Provider<T>, not T directly.  This is an important distinction // for dependency analysis tools that short-circuit on providers. Key < ? > providerKey = getKey ( ) . ofType ( Types . providerOf ( getKey ( ) . getTypeLiteral ( ) . getType ( ) ) ) ; return ImmutableSet . < Dependency < ? > > of ( Dependency . get ( providerKey ) ) ; } @ Override public String toString ( ) { return "Provider<" + getKey ( ) . getTypeLiteral ( ) + ">" ; } } ; }
Returns the looked up provider. The result is not valid until this lookup has been initialized,
which usually happens when the injector is created. The provider will throw an {@code
IllegalStateException} if you try to use it beforehand.
Returns the looked up provider . The result is not valid until this lookup has been initialized which usually happens when the injector is created . The provider will throw an {