| com.bm.ejb3guice.inject.Injector
All known Subclasses: com.bm.ejb3guice.inject.InjectorImpl,
Injector | public interface Injector (Code) | | Fulfills requests for the object instances that make up your application,
always ensuring that these instances are properly injected before they are
returned. The
Injector is the heart of the Guice framework,
although you don't typically interact with it directly very often. This
"behind-the-scenes" operation is what distinguishes the dependency
injection pattern from its cousin, service locator.
The
Injector API has a few additional features: it allows
pre-constructed instances to have their fields and methods injected and
offers programmatic introspection to support tool development.
Contains several default bindings:
Injectors are created using the facade class
Ejb3Guice .
author: crazybob@google.com (Bob Lee) |
findBindingsByType | List<Binding<T>> findBindingsByType(TypeLiteral<T> type)(Code) | | Finds all bindings to the given type. This method is part of the Injector
Introspection API and is primarily intended for use by tools.
|
getBinding | Binding<T> getBinding(Key<T> key)(Code) | | Gets a binding for the given key, or null if no binding for this key is
found. Note that if this key references an implementation class that can
be implicitly bound, this method may return null, but may later return the
implicit binding after it has been loaded. This method is part of the
Injector Introspection API and is primarily intended for use by tools.
|
getBindings | Map<Key<?>, Binding<?>> getBindings()(Code) | | Gets all explicit bindings. This method is part of the Injector
Introspection API and is primarily intended for use by tools.
|
getInstance | T getInstance(Key<T> key)(Code) | | Returns the appropriate instance for the given injection key; equivalent to
getProvider(key).get() . When feasible, it's generally preferable to
avoid using this method, in favor of having Guice inject your dependencies
ahead of time.
|
getInstance | T getInstance(Class<T> type)(Code) | | Returns the appropriate instance for the given type; equivalent to
getProvider(type).get() . When feasible, it's generally preferable
to avoid using this method, in favor of having Guice inject your
dependencies ahead of time.
|
getProvider | Provider<T> getProvider(Key<T> key)(Code) | | Returns the provider used to obtain instances for the given injection key.
When feasible, it's generally preferable to avoid using this method, in
favor of having Guice inject your dependencies ahead of time.
|
getProvider | Provider<T> getProvider(Class<T> type)(Code) | | Returns the provider used to obtain instances for the given injection key.
When feasible, it's generally preferable to avoid using this method, in
favor of having Guice inject your dependencies ahead of time.
|
getResolver | Resolver getResolver()(Code) | | Returns the resolver used by this injector to resolve injection requests.
This method is part of the Injector Introspection API and is primarily
intended for use by tools.
|
injectMembers | void injectMembers(Object o)(Code) | | Injects dependencies into the fields and methods of an existing object.
Ignores the presence or absence of an injectable constructor.
Whenever Guice creates an instance, it performs this injection
automatically (after first performing constructor injection), so if you're
able to let Guice create all your objects for you, you'll never need to
use this method.
|
|
|