There is `jackson-module-guice` as one of base modules: https://github.com/FasterXML/jackson-modules-base
which allows something like that I think. I haven't used it myself but others who have may be able to comment more. It adds support for connecting `@JacksonInject` annotation (that Jackson needs for wiring) with Guice component registrations. -+ Tatu +- On Sun, Aug 14, 2016 at 3:20 PM, Gelin Luo <[email protected]> wrote: > Suppose my bean that needs to be marshalled from a JSON string is: > > public class Foo { > private Dao dao > private String id; > private int n; > // other fields... > > @Inject > public Foo(Dao dao) { > this.dao = dao; > } > > public void setId(String id) {this.id = id;} > // other setters ... > } > > > Would like to know if there are way for Jackson to use Guice to provide > the bean instance (hence I got the `dao` injected) before setting > properties from the JSON string input? > > -- > You received this message because you are subscribed to the Google Groups > "jackson-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
