|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Container
Injects dependencies into constructors, methods and fields annotated with
@
Inject
. Provides access to Binding
s.
Automatically converts constants as needed from String
to any
primitive type as well as 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
.
ContainerBuilder
Method Summary | ||
---|---|---|
|
findBindingsByType(TypeLiteral<T> type)
Finds all bindings to the given type. |
|
|
getBinding(Key<T> key)
Gets a binding for the given key. |
|
Map<Key<?>,Binding<?>> |
getBindings()
Gets all bindings. |
|
|
getFactory(Class<T> type)
Gets the factory bound to the given type. |
|
|
getFactory(Class<T> type,
Annotation annotation)
Gets the factory bound to the given type and annotation. |
|
|
getFactory(Class<T> type,
Class<? extends Annotation> annotationType)
Gets the factory bound to the given type and annotation. |
|
|
getFactory(Key<T> key)
Gets the factory bound to the given key. |
|
|
getFactory(TypeLiteral<T> type)
Gets the factory bound to the given type. |
|
|
getFactory(TypeLiteral<T> type,
Annotation annotation)
Gets the factory bound to the given type and annotation. |
|
|
getFactory(TypeLiteral<T> type,
Class<? extends Annotation> annotationType)
Gets the factory bound to the given type and annotation. |
|
|
getInstance(Class<T> type)
Gets an instance from the factory bound to the given type. |
|
|
getInstance(Class<T> type,
Annotation annotation)
Gets an instance from the factory bound to the given type and annotation. |
|
|
getInstance(Class<T> type,
Class<? extends Annotation> annotationType)
Gets an instance from the factory bound to the given type and annotation. |
|
|
getInstance(Key<T> key)
Gets an instance from the factory bound to the given key. |
|
|
getInstance(TypeLiteral<T> type)
Gets an instance from the factory bound to the given type. |
|
|
getInstance(TypeLiteral<T> type,
Annotation annotation)
Gets an instance from the factory bound to the given type and annotation. |
|
|
getInstance(TypeLiteral<T> type,
Class<? extends Annotation> annotationType)
Gets an instance from the factory bound to the given type and annotation. |
|
void |
injectMembers(Object o)
Injects dependencies into the fields and methods of an existing object. |
Method Detail |
---|
void injectMembers(Object o)
<T> Factory<T> getFactory(Key<T> key)
Map<Key<?>,Binding<?>> getBindings()
<T> Binding<T> getBinding(Key<T> key)
<T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type)
<T> Factory<T> getFactory(Class<T> type)
<T> Factory<T> getFactory(TypeLiteral<T> type)
<T> T getInstance(TypeLiteral<T> type)
<T> T getInstance(Class<T> type)
<T> T getInstance(Key<T> key)
<T> T getInstance(TypeLiteral<T> type, Annotation annotation)
<T> T getInstance(Class<T> type, Annotation annotation)
<T> Factory<T> getFactory(Class<T> type, Annotation annotation)
<T> Factory<T> getFactory(TypeLiteral<T> type, Annotation annotation)
<T> T getInstance(TypeLiteral<T> type, Class<? extends Annotation> annotationType)
<T> T getInstance(Class<T> type, Class<? extends Annotation> annotationType)
<T> Factory<T> getFactory(Class<T> type, Class<? extends Annotation> annotationType)
<T> Factory<T> getFactory(TypeLiteral<T> type, Class<? extends Annotation> annotationType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |