Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
常量如何被程序/类与 gwt/gin 绑定?
代替:
bindConstant().annotatedWith(AString.class).to("XYZ");
我们需要:(显然,它不会编译)
bindConstant().annotatedWith(AString.class).to(CustomStringProvider.class);
因为这个常量存储在 cookie/离线存储中。
你不能简单bind(String.class).annotatedWith(AString.class).toProvider(CustomStringProvider.class)吗?
bind(String.class).annotatedWith(AString.class).toProvider(CustomStringProvider.class)
如果你有一个提供者,它显然不是一个常量。