for (OptionBuilder builder : builders) {
Option option = builder.create();
if (builder.annot != null) {
bind(String.class)
.annotatedWith(builder.annot)
.toProvider(new StringOptionProvider(option, builder.defaultValue))
.asEagerSingleton();
LOG.info("Binding option to annotation : " + builder.annot.getName());
}
else {
bind(String.class)
.annotatedWith(Names.named(option.getOpt()))
.toProvider(new StringOptionProvider(option, builder.defaultValue))
.asEagerSingleton();
LOG.info("Binding option to String : " + option.getOpt());
}
options.addOption(option);
}