public class ToGenericProvider<T> extends ScopedProvider<T> implements Provider<T>
| Modifier and Type | Class and Description |
|---|---|
class |
ToGenericProvider.SyntheticGenericProvider |
injected| Constructor and Description |
|---|
ToGenericProvider(GenericProvider<T> provider) |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
T |
get(Key<?> bound)
Special injector case for keys bound
to generic providers
|
void |
inject(ProvisionStack stack,
InjectorImpl injector)
Used by standard providers and some other
providers to delegate the injection to the
wrapped provider (when it's a wrapper provider)
or injecting some provider properties without
checking everything
|
boolean |
onBind(BinderImpl binder,
Key<?> key)
Listener method called when the provider
is bound.
|
boolean |
requiresJitScoping() |
Provider<T> |
withScope(Key<?> match,
Scope scope)
Adds the control of scoping the provider.
|
getScope, getScoped, getUnscopedisInjected, setInjectedpublic ToGenericProvider(GenericProvider<T> provider)
public void inject(ProvisionStack stack, InjectorImpl injector)
StdProviderUsed by standard providers and some other providers to delegate the injection to the wrapped provider (when it's a wrapper provider) or injecting some provider properties without checking everything
inject in class ScopedProvider<T>stack - The thread injection stack (passed as argument
instead of getting it from the thread-local held
by the injector)injector - The injector used to inject this providerpublic boolean onBind(BinderImpl binder, Key<?> key)
StdProviderAdds the control of the binding to the provider, used by standard providers to replace bindings and some other things.
onBind in class StdProvider<T>binder - The binder used to bind this providerkey - The bound keyToFactoryProvider that converts its binding
to another binding. (Removes its binding and adds another one)public T get()
public T get(Key<?> bound)
get in class StdProvider<T>public Provider<T> withScope(Key<?> match, Scope scope)
StdProvider
Scopes the provider with the given scope
withScope in class ScopedProvider<T>match - The key used to match the scopescope - The scope to applypublic boolean requiresJitScoping()
requiresJitScoping in class ScopedProvider<T>