You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConfigurationProvider must currently be extended as new types are supported. A more extensible approach would be to have a generic PropertyBinder interface that can be installed as part of a multibinding. When mapping a configuration the ConfigurationProvider will iterate though the set of PropertyBinder's to determine the most appropriate binder. A new serializer can be added as a new binding without having to modify the ConfigurationProvider interface.
public interface PropertyBinder {
}
public class BinderModule extends BootstrapModule {
public void configure(BootstrapBinder binder) {
Multibinder<PropertyBinder> binders = Multibinder.newSetBinder(binder, PropertyBinder.class)
binders.addBinding().to(StringPropertyBinder.class);
binders.addBinding().to(DoublePropertyBinder.class);
binders.addBinding().to(PropertiesPropertyBinder.class);
binders.addBinding().to(ObjectPropertyBinder.class);
binders.addBinding().to(IntegerPropertyBinder.class);
binders.addBinding().to(BooleanPropertyBinder.class);
binders.addBinding().to(InjectingPropertyBinder.class);
....
}
}
The text was updated successfully, but these errors were encountered:
ConfigurationProvider must currently be extended as new types are supported. A more extensible approach would be to have a generic PropertyBinder interface that can be installed as part of a multibinding. When mapping a configuration the ConfigurationProvider will iterate though the set of PropertyBinder's to determine the most appropriate binder. A new serializer can be added as a new binding without having to modify the ConfigurationProvider interface.
The text was updated successfully, but these errors were encountered: