A support class for {@link Module}s which reduces repetition and results in a more readable configuration. Simply extend this class, implement {@link #configure()}, and call the inherited methods which mirror those found in {@link Binder}. For example:
public class MyModule extends AbstractModule { protected void configure() { bind(Service.class).to(ServiceImpl.class).in(Singleton.class); bind(CreditCardPaymentService.class); bind(PaymentService.class).to(CreditCardPaymentService.class); bindConstant().annotatedWith(Names.named("port")).to(8080); } }
@author crazybob@google.com (Bob Lee)