com.google.inject
Interface Container


public interface Container

Injects dependencies into constructors, methods and fields annotated with @Inject. Iterates explicit Bindings.

Automatically converts constant values as needed from String to any primitive type in addition to enum and Class<?>. Automatically boxes and unboxes primitives. For example, in the absence of a binding to int, the container will look for a binding to Integer.

Contains several default bindings:

Author:
crazybob@google.com (Bob Lee)
See Also:
Guice

Method Summary
<T> List<Binding<T>>
findBindingsByType(TypeLiteral<T> type)
          Finds all bindings to the given type.
<T> Binding<T>
getBinding(Key<T> key)
          Gets a binding for the given key.
 Map<Key<?>,Binding<?>> getBindings()
          Gets all explicit bindings.
<T> Locator<T>
getLocator(Class<T> type)
          Gets the locator bound to the given type.
<T> Locator<T>
getLocator(Key<T> key)
          Gets the locator bound to the given key.
 void injectMembers(Object o)
          Injects dependencies into the fields and methods of an existing object.
 

Method Detail

injectMembers

void injectMembers(Object o)
Injects dependencies into the fields and methods of an existing object. Does not inject the constructor.


getBindings

Map<Key<?>,Binding<?>> getBindings()
Gets all explicit bindings.


getBinding

<T> Binding<T> getBinding(Key<T> key)
Gets a binding for the given key.


findBindingsByType

<T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type)
Finds all bindings to the given type.


getLocator

<T> Locator<T> getLocator(Key<T> key)
Gets the locator bound to the given key.


getLocator

<T> Locator<T> getLocator(Class<T> type)
Gets the locator bound to the given type.