使用 gwt/gin 通过程序/类绑定常量
常量如何与 gwt/gin 的程序/类绑定?
而不是:
bindConstant().annotatedWith(AString.class).to("XYZ");
我们需要:(显然,它不能编译)
bindConstant().annotatedWith(AString.class).to(CustomStringProvider.class);
因为这个常量存储在cookie/离线存储中。
How can the constant be bound by program/class with gwt/gin?
Instead of:
bindConstant().annotatedWith(AString.class).to("XYZ");
We need: ( Obviously, it doesn't compile )
bindConstant().annotatedWith(AString.class).to(CustomStringProvider.class);
Because this constant is stored in cookie/offline storage.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能简单地
bind(String.class).annotatedWith(AString.class).toProvider(CustomStringProvider.class)
吗?如果您有一个提供者,那么它显然不是一个常数。
Can't you simply
bind(String.class).annotatedWith(AString.class).toProvider(CustomStringProvider.class)
?If you have a provider, it's obviously not a constant.