Gin Injection Inside Class Generated By Deferred Binding

那年仲夏 提交于 2019-12-10 23:44:43

问题


Here is the problem, I have code being generated by Deferred Binding in GWT, and I would like to use Gin Injection inside of this code.

Initially, I attempted to put a private constructor with an @Inject annotation in the generated class, but GWT complained that it did not have a public noargs constructor. In any case, I also got errors regarding my attempts to inject something abstract without bindings, and feel like I couldn't possibly bind it since I don't have the type literal available at runtime.

My next attempt was to generate a Ginjector and Gin module inside the class itself, but got errors regarding the inability to find the Gin module for the Ginjector annotation, which was confusing to me. Besides, this would have isolated the injection to what could be generated, and not the external dependencies.

In any case, has anybody attempted such a thing? Does anybody have any advice?


回答1:


I'm trying to do this too. It looks like it's a planned feature that's been implemented in the trunk but won't be available until later.



来源:https://stackoverflow.com/questions/5490729/gin-injection-inside-class-generated-by-deferred-binding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!