Java – has multiple types of JSON string map [string, object]
•
Java
I have this JSON string:
{ "startDate" : "2014-12-17T14:31:40Z","name" : "Izek","age" : 12 }
When I use Jackson to convert it to map [string, object], the type of StartDate is string. How can I tell Jackson to convert it to datetime?
Solution
You need to explicitly format the data in objectmapper You can refer to date format mapping to JSON Jackson for more details Alternatively, you can use it as http://java.dzone.com/articles/how-serialize-javautildate
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码