Home
last modified time | relevance | path

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

123

/external/guice/core/src/com/google/inject/binder/
DLinkedBindingBuilder.java52 ScopedBindingBuilder toProvider(Provider<? extends T> provider); in toProvider() method
60 ScopedBindingBuilder toProvider(javax.inject.Provider<? extends T> provider); in toProvider() method
63 ScopedBindingBuilder toProvider(Class<? extends javax.inject.Provider<? extends T>> providerType); in toProvider() method
66 ScopedBindingBuilder toProvider( in toProvider() method
70 ScopedBindingBuilder toProvider(Key<? extends javax.inject.Provider<? extends T>> providerKey); in toProvider() method
/external/guice/extensions/assistedinject/test/com/google/inject/assistedinject/
DFactoryProvider2Test.java65 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Mustang.class)); in testAssistedFactory()
88 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Camaro.class)); in testAssistedFactoryWithAnnotations()
152 .toProvider(FactoryProvider.newFactory(SummerCarFactory.class, Corvette.class)); in testFactoryUsesInjectedConstructor()
189 .toProvider(FactoryProvider.newFactory(SummerCarFactory.class, Beetle.class)); in testConstructorDoesntNeedAllFactoryMethodArguments()
217 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Porsche.class)); in testMethodsAndFieldsGetInjected()
255 .toProvider( in testProviderInjection()
285 .toProvider( in testAssistedProviderInjection()
324 .toProvider( in testTypeTokenInjection()
358 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Z.class)); in testTypeTokenProviderInjection()
395 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Prius.class)); in testAssistInjectionInNonPublicConstructor()
[all …]
DFactoryProviderTest.java68 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Mustang.class)); in testAssistedFactory()
90 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Mustang.class)); in testFactoryBindingDependencies()
110 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Camaro.class)); in testAssistedFactoryWithAnnotations()
174 .toProvider(FactoryProvider.newFactory(SummerCarFactory.class, Corvette.class)); in testFactoryWithMultipleMethods()
253 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Porshe.class)); in testMethodsAndFieldsGetInjected()
291 .toProvider( in testProviderInjection()
323 .toProvider( in testTypeTokenInjection()
357 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Z.class)); in testTypeTokenProviderInjection()
395 .toProvider(FactoryProvider.newFactory(ColoredCarFactory.class, Prius.class)); in testAssistInjectionInNonPublicConstructor()
415 .toProvider( in testExceptionDuringConstruction()
[all …]
/external/guice/core/src/com/google/inject/internal/
DBindingBuilder.java106 public BindingBuilder<T> toProvider(Provider<? extends T> provider) { in toProvider() method in BindingBuilder
107 return toProvider((javax.inject.Provider<T>) provider); in toProvider()
111 public BindingBuilder<T> toProvider(javax.inject.Provider<? extends T> provider) { in toProvider() method in BindingBuilder
132 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
134 return toProvider(Key.get(providerType)); in toProvider()
138 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
140 return toProvider(Key.get(providerType)); in toProvider()
144 public BindingBuilder<T> toProvider( in toProvider() method in BindingBuilder
DRealOptionalBinder.java199 .toProvider(new RealDirectTypeProvider<T>(bindingSelection)); in addDirectTypeBinding()
252 .toProvider(optionalProviderFactory); in configure()
262 .toProvider(optionalJavaxProviderFactory); in configure()
267 .toProvider(new RealOptionalKeyProvider<T>(bindingSelection, optionalKey)); in configure()
282 .toProvider((Provider) javaOptionalProviderFactory); in bindJava8Optional()
287 .toProvider((Provider) javaOptionalProviderFactory); in bindJava8Optional()
291 .toProvider(new JavaOptionalProvider(bindingSelection, javaOptionalKey)); in bindJava8Optional()
/external/guice/extensions/servlet/test/com/google/inject/servlet/
DServletScopesTest.java67 bind(c).toProvider(Providers.of("c")).in(ServletScopes.REQUEST); in testIsRequestScopedPositive()
68 bind(d).toProvider(Providers.of("d")).in(RequestScoped.class); in testIsRequestScopedPositive()
74 bind(f).toProvider(Providers.of("f")).in(RequestScoped.class); in testIsRequestScopedPositive()
129 bind(c).toProvider(Providers.of("c")).in(Scopes.NO_SCOPE); in testIsRequestScopedNegative()
131 bind(e).toProvider(Providers.of("e")).asEagerSingleton(); in testIsRequestScopedNegative()
132 bind(f).toProvider(Providers.of("f")).in(Scopes.SINGLETON); in testIsRequestScopedNegative()
133 bind(g).toProvider(Providers.of("g")).in(Singleton.class); in testIsRequestScopedNegative()
134 bind(h).toProvider(Providers.of("h")).in(CustomScoped.class); in testIsRequestScopedNegative()
140 bind(i).toProvider(Providers.of("i")).in(CustomScoped.class); in testIsRequestScopedNegative()
/external/guice/core/test/com/google/inject/
DBinderTest.java568 bind(AbstractModule.class).annotatedWith(red).toProvider(Providers.<AbstractModule>of(null)); in configure()
569 bind(Binder.class).annotatedWith(red).toProvider(Providers.<Binder>of(null)); in configure()
570 bind(Binding.class).annotatedWith(red).toProvider(Providers.<Binding>of(null)); in configure()
571 bind(Injector.class).annotatedWith(red).toProvider(Providers.<Injector>of(null)); in configure()
572 bind(Key.class).annotatedWith(red).toProvider(Providers.<Key>of(null)); in configure()
573 bind(Module.class).annotatedWith(red).toProvider(Providers.<Module>of(null)); in configure()
574 bind(Provider.class).annotatedWith(red).toProvider(Providers.<Provider>of(null)); in configure()
575 bind(Scope.class).annotatedWith(red).toProvider(Providers.<Scope>of(null)); in configure()
576 bind(Stage.class).annotatedWith(red).toProvider(Providers.<Stage>of(null)); in configure()
577 bind(TypeLiteral.class).annotatedWith(red).toProvider(Providers.<TypeLiteral>of(null)); in configure()
[all …]
DDuplicateBindingsTest.java362 bind(Object.class).toProvider(a); in testEqualsNotCalledByDefaultOnProvider()
399 bind(Object.class).toProvider(a); in testHashcodeNeverCalledOnProviderInstance()
400 bind(Object.class).toProvider(b); in testHashcodeNeverCalledOnProviderInstance()
472 bind(Foo.class).toProvider(pFoo); in configure()
475 bind(Foo.class).toProvider(pclFoo); in configure()
528 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo); in configure()
531 bind(Foo.class).annotatedWith(named("pKey")).toProvider(pclFoo); in configure()
566 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo).in(scope); in configure()
569 bind(Foo.class).annotatedWith(named("pKey")).toProvider(pclFoo).in(scope); in configure()
599 bind(Foo.class).annotatedWith(named("pInstance")).toProvider(pFoo).in(scope); in configure()
[all …]
DNullableInjectionPointTest.java101 bind(Foo.class).toProvider(Providers.<Foo>of(null)); in createInjector()
132 bind(Foo.class).toProvider(Providers.<Foo>of(null));
152 bind(Foo.class).toProvider(Providers.<Foo>of(null)).in(Scopes.SINGLETON);
172 bind(Foo.class).toProvider(Providers.<Foo>of(null)).asEagerSingleton();
198 bind(Foo.class).toProvider(Providers.<Foo>of(null));
DProviderInjectionTest.java58 .toProvider( in testProvidersAreInjectedWhenBound()
93 .toProvider( in testProvidersAreInjectedBeforeTheyAreUsed()
110 .toProvider( in testProvidersAreInjectedBeforeTheyAreUsed()
153 .toProvider( in testCreationTimeInjectionOrdering()
DCircularDependencyTest.java83 .toProvider( in testCircularlyDependentConstructorsWithProviderInstances()
94 .toProvider( in testCircularlyDependentConstructorsWithProviderInstances()
114 bind(A.class).toProvider(AP.class).in(Singleton.class); in testCircularlyDependentConstructorsWithProviderKeys()
115 bind(B.class).toProvider(BP.class); in testCircularlyDependentConstructorsWithProviderKeys()
276 bind(C2.class).toProvider(C2P.class); in testUnresolvableCircularDependenciesWithProviderKeys()
277 bind(D2.class).toProvider(D2P.class); in testUnresolvableCircularDependenciesWithProviderKeys()
401 bind(C2.class).toProvider(C2P.class); in testDisabledCircularDependenciesWithProviderKeys()
402 bind(D2.class).toProvider(D2P.class); in testDisabledCircularDependenciesWithProviderKeys()
DScopesTest.java631 bind(c).toProvider(Providers.of("c")).in(Scopes.SINGLETON);
633 bind(e).toProvider(Providers.of("e")).asEagerSingleton();
634 bind(f).toProvider(Providers.of("f")).in(Singleton.class);
640 bind(i).toProvider(Providers.of("i")).in(Singleton.class);
693 bind(c).toProvider(Providers.of("c")).in(Scopes.NO_SCOPE);
694 bind(d).toProvider(Providers.of("d")).in(CustomScoped.class);
700 bind(f).toProvider(Providers.of("f")).in(CustomScoped.class);
749 bind(c).toProvider(Providers.of("c")).in(CUSTOM_SCOPE);
750 bind(d).toProvider(Providers.of("d")).in(CustomScoped.class);
756 bind(g).toProvider(Providers.of("g")).in(CustomScoped.class);
[all …]
DBoundProviderTest.java30 bind(Foo.class).toProvider(FooProvider.class); in testFooProvider()
50 bind(Foo.class).toProvider(SingletonFooProvider.class); in testSingletonFooProvider()
DProvisionExceptionTest.java100 bind(D.class).toProvider(new DProvider()); in testBindToProviderInstanceExceptions()
136 bind(F.class).toProvider(FProvider.class); in testProvisionExceptionsAreWrappedForBindToProviderType()
158 bind(F.class).toProvider(new FProvider()); in testProvisionExceptionsAreWrappedForBindToProviderInstance()
320 bind(D.class).toProvider(DProvider.class); in testProviderKeyBindings()
DBoundInstanceInjectionTest.java64 .toProvider( in testProvidersAreInjected()
108 bind(String.class).toProvider(new MalformedProvider()); in testMalformedProvider()
/external/guice/jdk8-tests/test/com/google/inject/jdk8/
DJava8LanguageFeatureBindingTest.java105 bind(String.class).toProvider(StringProvider.class); in testProvider_usingJdk8Features()
120 bind(String.class).toProvider(StringProvider.class); in testProvider_usingJdk8Features()
148 bind(String.class).toProvider(() -> "Hello" + i.incrementAndGet()); in testBinding_toProvider_lambda()
162 bind(String.class).toProvider(Java8LanguageFeatureBindingTest.this::provideString); in testBinding_toProvider_methodReference()
/external/guice/core/test/com/google/inject/spi/
DSpiBindingsTest.java110 bind(String.class).toProvider(stringProvider); in testToProviderBinding()
137 bind(String.class).toProvider(StringProvider.class); in testToProviderKeyBinding()
310 .toProvider(StringProvider.class) in testScopes()
314 .toProvider(StringProvider.class) in testScopes()
318 .toProvider(StringProvider.class) in testScopes()
320 bind(String.class).annotatedWith(Names.named("d")).toProvider(StringProvider.class); in testScopes()
393 .toProvider( in testExtensionSpi()
DToolStageInjectorTest.java84 bind(Object.class).toProvider(foo); in testToolStageDoesntInjectProviders()
124 bind(Object.class).toProvider(tooled); in testToolStageInjectsTooledMethods()
/external/guice/extensions/testlib/src/com/google/inject/testing/fieldbinder/
DBoundFieldModule.java315 binderUnsafe.toProvider( in bindField()
332 binderUnsafe.toProvider(fieldValueUnsafe); in bindField()
335 binderUnsafe.toProvider( in bindField()
346 binderUnsafe.toProvider(Providers.of(null)); in bindField()
/external/guice/extensions/spring/test/com/google/inject/spring/
DSpringIntegrationTest.java50 bind(Singleton.class).toProvider(fromSpring(Singleton.class, "singleton")); in testBindFromSpring()
51 bind(Prototype.class).toProvider(fromSpring(Prototype.class, "prototype")); in testBindFromSpring()
/external/guice/core/test/com/googlecode/guice/
DJsr330Test.java277 bind(B.class).toProvider(BProvider.class); in testBindProviderClass()
278 bind(B.class).annotatedWith(Names.named("1")).toProvider(BProvider.class); in testBindProviderClass()
279 bind(B.class).annotatedWith(Names.named("2")).toProvider(Key.get(BProvider.class)); in testBindProviderClass()
282 .toProvider(TypeLiteral.get(BProvider.class)); in testBindProviderClass()
343 bind(String.class).toProvider(guicified); in testGuicifyWithDependencies()
/external/guice/extensions/persist/src/com/google/inject/persist/jpa/
DJpaPersistModule.java65 bind(EntityManager.class).toProvider(JpaPersistService.class); in configurePersistence()
67 .toProvider(JpaPersistService.EntityManagerFactoryProvider.class); in configurePersistence()
/external/guice/core/test/com/google/inject/internal/
DMultibinderTest.java375 .toProvider( in testMultibinderSetIsLazy()
402 multibinder.addBinding().toProvider(Providers.of("A")); in testMultibinderSetForbidsDuplicateElements()
473 multibinder.addBinding().toProvider(Providers.of(new ValueType(1, 2))); in testMultibinderSetShowsBothElementsIfToStringDifferent()
560 multibinder.addBinding().toProvider(Providers.of("B")); in testMultibinderSetPermitDuplicateElementsFromOtherModule()
633 .toProvider(Providers.<String>of(null)); in testMultibinderSetForbidsNullElements()
962 multibinder.addBinding().toProvider(Providers.of("A")); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderInstance()
963 multibinder.addBinding().toProvider(Providers.of("B")); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderInstance()
996 multibinder.addBinding().toProvider(Key.get(AStringProvider.class)); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderKey()
997 multibinder.addBinding().toProvider(Key.get(BStringProvider.class)); in testModuleOverrideRepeatedInstallsAndMultibindings_toProviderKey()
1406 multibinder.addBinding().toProvider(Providers.of("A")); in testMultibinderCanInjectCollectionOfProviders()
[all …]
/external/guice/core/test/com/google/inject/util/
DOverrideModuleTest.java117 bind(key2).toProvider(getProvider(String.class)); in testGetProviderInModule()
132 bind(key2).toProvider(getProvider(String.class)); in testOverrideWhatGetProviderProvided()
157 bind(String.class).toProvider(getProvider(key2)); in testOverrideUsingOriginalsGetProvider()
694 bind(Object.class).toProvider(a); in testEqualsNotCalledByDefaultOnProvider()
735 bind(Object.class).toProvider(a); in testHashcodeNeverCalledOnProviderInstance()
736 bind(Object.class).toProvider(b); in testHashcodeNeverCalledOnProviderInstance()
/external/testng/src/test/java/test/guice/
DGuiceParentModule.java19 bind(MyService.class).toProvider(MyServiceProvider.class); in configure()

123