I have a class like this:
class MyClass {
CustomList<String> list = ListUtils.createCustomList();
}
Where interface CustomList implements java.util.List
so it cannot be deserialized with a constructor. Instead there is a class ListUtils
which creates an implementation instance. Both the interface and the utility class are in an external library so I can't annotate them.
How can I tell Jackson that when encountering CustomList
it should invoke ListUtils.createCustomList()
instead of a constructor? Is there a mixin configuration, a mapping I can specify from type to construction method, or a custom deserializer I need to write?