Home
last modified time | relevance | path

Searched refs:toProvider (Results 1 – 25 of 62) sorted by relevance

123

/external/guice/core/src/com/google/inject/binder/
DLinkedBindingBuilder.java59 ScopedBindingBuilder toProvider(Provider<? extends T> provider); in toProvider() method
67 ScopedBindingBuilder toProvider(javax.inject.Provider<? extends T> provider); in toProvider() method
72 ScopedBindingBuilder toProvider( in toProvider() method
78 ScopedBindingBuilder toProvider( in toProvider() method
84 ScopedBindingBuilder toProvider( in toProvider() method
/external/guice/extensions/assistedinject/test/com/google/inject/assistedinject/
DFactoryProvider2Test.java55 bind(ColoredCarFactory.class).toProvider( in testAssistedFactory()
76 bind(ColoredCarFactory.class).toProvider( in testAssistedFactoryWithAnnotations()
138 bind(SummerCarFactory.class).toProvider( in testFactoryUsesInjectedConstructor()
173 bind(SummerCarFactory.class).toProvider( in testConstructorDoesntNeedAllFactoryMethodArguments()
198 bind(ColoredCarFactory.class).toProvider( in testMethodsAndFieldsGetInjected()
233 bind(ColoredCarFactory.class).toProvider( in testProviderInjection()
260 bind(ColoredCarFactory.class).toProvider( in testAssistedProviderInjection()
294 bind(ColoredCarFactory.class).toProvider( in testTypeTokenInjection()
325 bind(ColoredCarFactory.class).toProvider( in testTypeTokenProviderInjection()
360 bind(ColoredCarFactory.class).toProvider( in testAssistInjectionInNonPublicConstructor()
[all …]
DFactoryProviderTest.java60 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Mustang.class)); in testAssistedFactory()
80 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Mustang.class)); in testFactoryBindingDependencies()
97 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Camaro.class)); in testAssistedFactoryWithAnnotations()
158 bind(SummerCarFactory.class).toProvider( in testFactoryWithMultipleMethods()
234 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Porshe.class)); in testMethodsAndFieldsGetInjected()
269 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Firebird.class)); in testProviderInjection()
297 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, DeLorean.class)); in testTypeTokenInjection()
328 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Z.class)); in testTypeTokenProviderInjection()
364 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Prius.class)); in testAssistInjectionInNonPublicConstructor()
381 bind(ColoredCarFactory.class).toProvider( in testExceptionDuringConstruction()
[all …]
/external/guice/core/src/com/google/inject/internal/
DBindingBuilder.java99 public BindingBuilder<T> toProvider(Provider<? extends T> provider) { in toProvider() method in BindingBuilder
100 return toProvider((javax.inject.Provider<T>) provider); in toProvider()
103 public BindingBuilder<T> toProvider(javax.inject.Provider<? extends T> provider) { in toProvider() method in BindingBuilder
122 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
124 return toProvider(Key.get(providerType)); in toProvider()
127 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
129 return toProvider(Key.get(providerType)); in toProvider()
132 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
/external/guice/extensions/servlet/test/com/google/inject/servlet/
DServletScopesTest.java68 bind(c).toProvider(Providers.of("c")).in(ServletScopes.REQUEST); in testIsRequestScopedPositive()
69 bind(d).toProvider(Providers.of("d")).in(RequestScoped.class); in testIsRequestScopedPositive()
74 bind(f).toProvider(Providers.of("f")).in(RequestScoped.class); in testIsRequestScopedPositive()
128 bind(c).toProvider(Providers.of("c")).in(Scopes.NO_SCOPE); in testIsRequestScopedNegative()
130 bind(e).toProvider(Providers.of("e")).asEagerSingleton(); in testIsRequestScopedNegative()
131 bind(f).toProvider(Providers.of("f")).in(Scopes.SINGLETON); in testIsRequestScopedNegative()
132 bind(g).toProvider(Providers.of("g")).in(Singleton.class); in testIsRequestScopedNegative()
133 bind(h).toProvider(Providers.of("h")).in(CustomScoped.class); in testIsRequestScopedNegative()
138 bind(i).toProvider(Providers.of("i")).in(CustomScoped.class); in testIsRequestScopedNegative()
/external/guice/core/test/com/google/inject/
DBinderTest.java488 .toProvider(Providers.<AbstractModule>of(null)); in configure()
489 bind(Binder.class).annotatedWith(red).toProvider(Providers.<Binder>of(null)); in configure()
490 bind(Binding.class).annotatedWith(red).toProvider(Providers.<Binding>of(null)); in configure()
491 bind(Injector.class).annotatedWith(red).toProvider(Providers.<Injector>of(null)); in configure()
492 bind(Key.class).annotatedWith(red).toProvider(Providers.<Key>of(null)); in configure()
493 bind(Module.class).annotatedWith(red).toProvider(Providers.<Module>of(null)); in configure()
494 bind(Provider.class).annotatedWith(red).toProvider(Providers.<Provider>of(null)); in configure()
495 bind(Scope.class).annotatedWith(red).toProvider(Providers.<Scope>of(null)); in configure()
496 bind(Stage.class).annotatedWith(red).toProvider(Providers.<Stage>of(null)); in configure()
497 bind(TypeLiteral.class).annotatedWith(red).toProvider(Providers.<TypeLiteral>of(null)); in configure()
[all …]
DDuplicateBindingsTest.java282 bind(Object.class).toProvider(a); in testEqualsNotCalledByDefaultOnProvider()
317 bind(Object.class).toProvider(a); in testHashcodeNeverCalledOnProviderInstance()
318 bind(Object.class).toProvider(b); in testHashcodeNeverCalledOnProviderInstance()
372 bind(Foo.class).toProvider(pFoo); in configure()
375 bind(Foo.class).toProvider(pclFoo); in configure()
421 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo); in configure()
424 bind(Foo.class).annotatedWith(named("pKey")).toProvider(pclFoo); in configure()
454 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo).in(scope); in configure()
457 bind(Foo.class).annotatedWith(named("pKey")).toProvider(pclFoo).in(scope); in configure()
483 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo).in(scope); in configure()
[all …]
DProviderInjectionTest.java57 bind(Bar.class).toProvider(new Provider<Bar>() { in testProvidersAreInjectedWhenBound()
86 bind(String.class).toProvider(new Provider<String>() { in testProvidersAreInjectedBeforeTheyAreUsed()
97 bind(List.class).toProvider(new Provider<List>() { in testProvidersAreInjectedBeforeTheyAreUsed()
130 bind(Count.class).annotatedWith(named("b")).toProvider(new Provider<Count>() { in testCreationTimeInjectionOrdering()
DCircularDependencyTest.java72 bind(A.class).toProvider(new Provider<A>() { in testCircularlyDependentConstructorsWithProviderInstances()
78 bind(B.class).toProvider(new Provider<B>() { in testCircularlyDependentConstructorsWithProviderInstances()
93 bind(A.class).toProvider(AP.class).in(Singleton.class); in testCircularlyDependentConstructorsWithProviderKeys()
94 bind(B.class).toProvider(BP.class); in testCircularlyDependentConstructorsWithProviderKeys()
222 bind(C2.class).toProvider(C2P.class); in testUnresolvableCircularDependenciesWithProviderKeys()
223 bind(D2.class).toProvider(D2P.class); in testUnresolvableCircularDependenciesWithProviderKeys()
313 bind(C2.class).toProvider(C2P.class); in testDisabledCircularDependenciesWithProviderKeys()
314 bind(D2.class).toProvider(D2P.class); in testDisabledCircularDependenciesWithProviderKeys()
DScopesTest.java559 bind(c).toProvider(Providers.of("c")).in(Scopes.SINGLETON);
561 bind(e).toProvider(Providers.of("e")).asEagerSingleton();
562 bind(f).toProvider(Providers.of("f")).in(Singleton.class);
566 bind(i).toProvider(Providers.of("i")).in(Singleton.class);
614 bind(c).toProvider(Providers.of("c")).in(Scopes.NO_SCOPE);
615 bind(d).toProvider(Providers.of("d")).in(CustomScoped.class);
619 bind(f).toProvider(Providers.of("f")).in(CustomScoped.class);
663 bind(c).toProvider(Providers.of("c")).in(CUSTOM_SCOPE);
664 bind(d).toProvider(Providers.of("d")).in(CustomScoped.class);
668 bind(g).toProvider(Providers.of("g")).in(CustomScoped.class);
[all …]
DNullableInjectionPointTest.java103 bind(Foo.class).toProvider(new Provider<Foo>() { in createInjector()
133 bind(Foo.class).toProvider(new Provider<Foo>() {
154 bind(Foo.class).toProvider(new Provider<Foo>() {
175 bind(Foo.class).toProvider(new Provider<Foo>() {
DProvisionExceptionTest.java90 bind(D.class).toProvider(new DProvider()); in testBindToProviderInstanceExceptions()
120 bind(F.class).toProvider(FProvider.class); in testProvisionExceptionsAreWrappedForBindToProviderType()
135 bind(F.class).toProvider(new FProvider()); in testProvisionExceptionsAreWrappedForBindToProviderInstance()
260 bind(D.class).toProvider(DProvider.class); in testProviderKeyBindings()
DBoundProviderTest.java29 bind(Foo.class).toProvider(FooProvider.class); in testFooProvider()
46 bind(Foo.class).toProvider(SingletonFooProvider.class); in testSingletonFooProvider()
DBoundInstanceInjectionTest.java60 bind(O.class).toProvider(new Provider<O>() { in testProvidersAreInjected()
94 bind(String.class).toProvider(new MalformedProvider()); in testMalformedProvider()
/external/guice/jdk8-tests/test/com/google/inject/jdk8/
DJava8LanguageFeatureBindingTest.java104 bind(String.class).toProvider(StringProvider.class); in testProvider_usingJdk8Features()
117 bind(String.class).toProvider(StringProvider.class); in testProvider_usingJdk8Features()
145 bind(String.class).toProvider(() -> "Hello" + i.incrementAndGet()); in testBinding_toProvider_lambda()
157 bind(String.class).toProvider(Java8LanguageFeatureBindingTest.this::provideString); in testBinding_toProvider_methodReference()
/external/guice/core/test/com/google/inject/spi/
DSpiBindingsTest.java109 bind(String.class).toProvider(stringProvider); in testToProviderBinding()
135 bind(String.class).toProvider(StringProvider.class); in testToProviderKeyBinding()
291 .toProvider(StringProvider.class).in(Singleton.class); in testScopes()
293 .toProvider(StringProvider.class).in(Scopes.SINGLETON); in testScopes()
295 .toProvider(StringProvider.class).asEagerSingleton(); in testScopes()
297 .toProvider(StringProvider.class); in testScopes()
359 bind(String.class).toProvider(new ProviderWithExtensionVisitor<String>() { in testExtensionSpi()
DToolStageInjectorTest.java83 bind(Object.class).toProvider(foo); in testToolStageDoesntInjectProviders()
117 bind(Object.class).toProvider(tooled); in testToolStageInjectsTooledMethods()
/external/guice/extensions/spring/test/com/google/inject/spring/
DSpringIntegrationTest.java55 .toProvider(fromSpring(Singleton.class, "singleton")); in testBindFromSpring()
57 .toProvider(fromSpring(Prototype.class, "prototype")); in testBindFromSpring()
/external/guice/core/test/com/googlecode/guice/
DJsr330Test.java244 bind(B.class).toProvider(BProvider.class); in testBindProviderClass()
245 bind(B.class).annotatedWith(Names.named("1")).toProvider(BProvider.class); in testBindProviderClass()
246 bind(B.class).annotatedWith(Names.named("2")).toProvider(Key.get(BProvider.class)); in testBindProviderClass()
247 bind(B.class).annotatedWith(Names.named("3")).toProvider(TypeLiteral.get(BProvider.class)); in testBindProviderClass()
300 bind(String.class).toProvider(guicified); in testGuicifyWithDependencies()
/external/guice/extensions/persist/src/com/google/inject/persist/jpa/
DJpaPersistModule.java69 bind(EntityManager.class).toProvider(JpaPersistService.class); in configurePersistence()
71 .toProvider(JpaPersistService.EntityManagerFactoryProvider.class); in configurePersistence()
/external/guice/extensions/multibindings/test/com/google/inject/multibindings/
DMultibinderTest.java315 .addBinding().toProvider(new Provider<Integer>() { in testMultibinderSetIsLazy()
336 multibinder.addBinding().toProvider(Providers.of("A")); in testMultibinderSetForbidsDuplicateElements()
390 multibinder.addBinding().toProvider(Providers.of(new ValueType(1, 2))); in testMultibinderSetShowsBothElementsIfToStringDifferent()
472 .addBinding().toProvider(Providers.<String>of(null)); in testMultibinderSetForbidsNullElements()
742 multibinder.addBinding().toProvider(Providers.of("A")); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderInstance()
743 multibinder.addBinding().toProvider(Providers.of("B")); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderInstance()
773 multibinder.addBinding().toProvider(Key.get(AStringProvider.class)); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderKey()
774 multibinder.addBinding().toProvider(Key.get(BStringProvider.class)); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderKey()
1144 multibinder.addBinding().toProvider(Providers.of("A")); in testMultibinderCanInjectCollectionOfProviders()
1145 multibinder.addBinding().toProvider(Providers.of("B")); in testMultibinderCanInjectCollectionOfProviders()
[all …]
/external/guice/core/test/com/google/inject/util/
DOverrideModuleTest.java112 bind(key2).toProvider(getProvider(String.class)); in testGetProviderInModule()
125 bind(key2).toProvider(getProvider(String.class)); in testOverrideWhatGetProviderProvided()
146 bind(String.class).toProvider(getProvider(key2)); in testOverrideUsingOriginalsGetProvider()
591 bind(Object.class).toProvider(a); in testEqualsNotCalledByDefaultOnProvider()
626 bind(Object.class).toProvider(a); in testHashcodeNeverCalledOnProviderInstance()
627 bind(Object.class).toProvider(b); in testHashcodeNeverCalledOnProviderInstance()
/external/testng/src/test/java/test/guice/
DGuiceParentModule.java19 bind(MyService.class).toProvider(MyServiceProvider.class); in configure()
/external/guice/extensions/multibindings/src/com/google/inject/multibindings/
DOptionalBinder.java354 binder.bind(typeKey).toProvider(new RealDirectTypeProvider()); in addDirectTypeBinding()
380 binder.bind(optionalProviderKey).toProvider(new RealOptionalProviderProvider()); in configure()
388 binder.bind(optionalKey).toProvider(new RealOptionalKeyProvider()); in configure()
397 binder.bind(javaOptionalKey).toProvider(new JavaOptionalProvider()); in bindJava8Optional()
398 binder.bind(javaOptionalProviderKey).toProvider(new JavaOptionalProviderProvider()); in bindJava8Optional()
/external/guice/core/test/com/google/inject/example/
DJndiProviderClient.java40 .toProvider(fromJndi(DataSource.class, "...")); in main()

123