public abstract class StdProvider<T> extends java.lang.Object implements Provider<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
injected |
| Constructor and Description |
|---|
StdProvider() |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
T |
get(Key<?> match) |
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 |
isInjected() |
boolean |
onBind(BinderImpl binder,
Key<?> key)
Listener method called when the provider
is bound.
|
void |
setInjected(boolean injected) |
Provider<T> |
withScope(Key<?> match,
Scope scope)
Adds the control of scoping the provider.
|
public boolean isInjected()
public void setInjected(boolean injected)
public Provider<T> withScope(Key<?> match, Scope scope)
Scopes the provider with the given scope
match - The key used to match the scopescope - The scope to applypublic 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
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)
Adds the control of the binding to the provider, used by standard providers to replace bindings and some other things.
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)