mardi 9 août 2016

How does jackson know the type of generic objects in Java?

I use Jackson to parse strings to Java objects. For example Java object is:

class MyObject {
  MyField myField;
  List<MyListField> myList;
}

In runtime I have info about myField and can instantiate it via reflection:

myObject.myField = MyField.newInstance()

In runtime I don't have info about generic type of myList, and I can not fill it with MyListField instances. How does Jackson do it?





Aucun commentaire:

Enregistrer un commentaire