首页 > 解决方案 > Guice 私有模块与匹配器绑定

问题描述

我有一个私有的 Guice 模块,我想将它应用于某些类。

这是通过以下方式完成的:

// Inside module code
bind(SomeClass.class)
expose(SomeClass.class)

是否可以使用匹配器进行通用操作?类似于 bindInterceptor?

就像是:

bind(any(), annotatedWith(SomeAnnotation.class));
expose(any(), annotatedWith(SomeAnnotation.class))

标签: javaguice

解决方案


推荐阅读