I'm trying to deserialize Objects (with private constructors) from JSONArray by Jackson annotations using external class for creating objects.

Class Vehicle

Subclasses with private constructor Car Bike Motocycle

External class CarCreator with method createBike, createMotocycle, createCar

The error I got since now: Cannot construct instance of (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)

I can't find a way to create Subclasses by external Class.

0

There are 0 best solutions below