Guice - 如何将类的所有子类绑定到公共子类?

时间:2016-04-02 18:23:08

标签: guice

我想将所有UseCaseFactory子类绑定到UseCaseFactories(这是所有子类的子类)。

enter image description here

而不是列出所有子类(这可行):

bind(DeleteEmployeeUseCaseFactory.class).toInstance(useCaseFactories);
bind(GetEmployeeUseCaseFactory.class).toInstance(useCaseFactories);

我想做这样的事情。我怎么能?

bind(subClassesOf(UseCaseFactory.class)).toInstance(useCaseFactories);

0 个答案:

没有答案