|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.inject.ContainerBuilder.BindingBuilder<T>
public class ContainerBuilder.BindingBuilder<T>
Binds a Key
to an implementation in a given scope.
Method Summary | ||
---|---|---|
ContainerBuilder.BindingBuilder<T> |
in(Scope scope)
Specifies the scope. |
|
ContainerBuilder.BindingBuilder<T> |
in(java.lang.String scopeName)
Specifies the scope. |
|
ContainerBuilder.BindingBuilder<T> |
inContainerScope()
Specifies container scope (i.e. one instance per container). |
|
ContainerBuilder.BindingBuilder<T> |
named(java.lang.String name)
Sets the name of this binding. |
|
ContainerBuilder.BindingBuilder<T> |
preload()
Instructs the builder to eagerly load this binding when it creates the container. |
|
|
to(java.lang.Class<I> implementation)
Binds to instances of the given implementation class. |
|
ContainerBuilder.BindingBuilder<T> |
to(ContextualFactory<? extends T> factory)
Binds to instances from the given factory. |
|
ContainerBuilder.BindingBuilder<T> |
to(Factory<? extends T> factory)
Binds to instances from the given factory. |
|
ContainerBuilder.BindingBuilder<T> |
to(T instance)
Binds to the given instance. |
|
|
to(TypeLiteral<I> implementation)
Binds to instances of the given implementation type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ContainerBuilder.BindingBuilder<T> named(java.lang.String name)
public <I extends T> ContainerBuilder.BindingBuilder<T> to(java.lang.Class<I> implementation)
Container
will inject the implementation instances as well. Sets the
scope based on the @Scoped
annotation on the implementation
class if present.
public <I extends T> ContainerBuilder.BindingBuilder<T> to(TypeLiteral<I> implementation)
Container
will inject the implementation instances as well. Sets the
scope based on the @Scoped
annotation on the implementation
class if present.
public ContainerBuilder.BindingBuilder<T> to(ContextualFactory<? extends T> factory)
public ContainerBuilder.BindingBuilder<T> to(Factory<? extends T> factory)
public ContainerBuilder.BindingBuilder<T> to(T instance)
public ContainerBuilder.BindingBuilder<T> in(java.lang.String scopeName)
ContainerBuilder.scope(String, Scope)
.
public ContainerBuilder.BindingBuilder<T> in(Scope scope)
public ContainerBuilder.BindingBuilder<T> inContainerScope()
public ContainerBuilder.BindingBuilder<T> preload()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |