Kevin Dolan
Kevin Dolan

Reputation: 5097

Gin Injection Inside Class Generated By Deferred Binding

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?

Upvotes: 2

Views: 846

Answers (1)

Daniel
Daniel

Reputation: 10235

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.

Upvotes: 1

Related Questions