com.google.inject.binder
Interface BindingImplementationBuilder<T>

All Known Subinterfaces:
BindingBuilder<T>

public interface BindingImplementationBuilder<T>

Specifies an implementation for a binding.

Author:
crazybob@google.com (Bob Lee)

Method Summary
 BindingScopeBuilder to(Class<? extends T> implementation)
          Binds to instances of the given implementation class.
 BindingScopeBuilder to(TypeLiteral<? extends T> implementation)
          Binds to instances of the given implementation class.
 BindingScopeBuilder toFactory(Class<? extends Factory<? extends T>> factoryType)
          Binds to instances from the factory bound to the given factory type.
 BindingScopeBuilder toFactory(Factory<? extends T> factory)
          Binds to instances generated by the given factory.
 BindingScopeBuilder toFactory(Key<? extends Factory<? extends T>> factoryKey)
          Binds to instances from the factory bound to the given key.
 void toInstance(T instance)
          Binds to the given instance.
 

Method Detail

to

BindingScopeBuilder to(Class<? extends T> implementation)
Binds to instances of the given implementation class. The Container will inject implementation as well. Sets the scope based on an annotation on the implementation class if present.


to

BindingScopeBuilder to(TypeLiteral<? extends T> implementation)
Binds to instances of the given implementation class. The Container will inject implementation as well. Sets the scope based on an annotation on the implementation class if present.


toInstance

void toInstance(T instance)
Binds to the given instance.


toFactory

BindingScopeBuilder toFactory(Factory<? extends T> factory)
Binds to instances generated by the given factory.


toFactory

BindingScopeBuilder toFactory(Class<? extends Factory<? extends T>> factoryType)
Binds to instances from the factory bound to the given factory type.


toFactory

BindingScopeBuilder toFactory(Key<? extends Factory<? extends T>> factoryKey)
Binds to instances from the factory bound to the given key.