public abstract class AbstractGinModule extends Object implements GinModule
GinModule
s which reduces repetition and results in
a more readable configuration. Simply extend this class, implement configure()
, and call the inherited methods which mirror those found in
GinBinder
. For example:
public class MyModule extends AbstractGinModule { protected void configure() { bind(Service.class).to(ServiceImpl.class).in(Singleton.class); bind(CreditCardPaymentService.class); bind(PaymentService.class).to(CreditCardPaymentService.class); } }
Constructor and Description |
---|
AbstractGinModule() |
Modifier and Type | Method and Description |
---|---|
protected <T> GinAnnotatedBindingBuilder<T> |
bind(Class<T> clazz) |
protected <T> GinLinkedBindingBuilder<T> |
bind(Key<T> key) |
protected <T> GinAnnotatedBindingBuilder<T> |
bind(TypeLiteral<T> type) |
protected GinAnnotatedConstantBindingBuilder |
bindConstant() |
protected GinBinder |
binder()
Gets direct access to the underlying
GinBinder . |
protected abstract void |
configure() |
void |
configure(GinBinder binder)
Contributes bindings and other configurations for this module to
binder . |
protected void |
install(GinModule install) |
protected void |
requestStaticInjection(Class<?>... types) |
public final void configure(GinBinder binder)
GinModule
binder
.protected abstract void configure()
protected final <T> GinAnnotatedBindingBuilder<T> bind(Class<T> clazz)
GinBinder.bind(Class)
protected final <T> GinAnnotatedBindingBuilder<T> bind(TypeLiteral<T> type)
GinBinder.bind(TypeLiteral)
protected final <T> GinLinkedBindingBuilder<T> bind(Key<T> key)
GinBinder.bind(Key)
protected final GinAnnotatedConstantBindingBuilder bindConstant()
GinBinder.bindConstant()
protected final void install(GinModule install)
GinBinder#install(Module)
protected void requestStaticInjection(Class<?>... types)
protected GinBinder binder()
GinBinder
.Copyright © 2008–2018. All rights reserved.