我正在使用MapBinder将键映射到它们各自的实现。现在我有这样的事情:
MapBinder<String, Processor> processor
= MapBinder.newMapBinder(binder(), String.class, Processor.class);
processor.addBinding("a1").to(a1Processor.class).in(Scopes.SINGLETON);
processor.addBinding("a2").to(a2Processor.class).in(Scopes.SINGLETON);
processor.addBinding("a3").to(a3Processor.class).in(Scopes.SINGLETON);它按预期的方式工作。但是现在我正在考虑创建一个DefaultProcessor并绑定除thisString之外的任何其他内容。是否有可能做到这一点?a2a3DefaultProcessor
Helenr
慕运维8079593
随时随地看视频慕课网APP
相关分类