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 ...
}
If I run JSON.parseObject(input, Foo.class)
I will get an error says: default constructor not found
.
I would like to know if there are any way to let FastJson able to work with Guice and have Guice to provide the bean instance before setting properties from the JSON string input.
2条答案
按热度按时间1tu0hz3e1#
it can not support, because it may be a security problem
wixjitnu2#
How come? Can you please elaborate?