My pojo class having some field whose datatype is XMLGregorianCalendar.
protected XMLGregorianCalendar driverBirthDate; //the value is -"1967-08-13-05:45"
While I am converting the object to json string using GSON the output is generating something else for this field.
Gson gson = new Gson();
String str = gson.toJson(pojoObj);
After convert -
"driverBirthDate": {
"day": 13,
"hour": -2147483648,
"minute": -2147483648,
"month": 8,
"second": -2147483648,
"timezone": -345,
"year": 1967
}
But I need the exact same format what pojo object holds.
Any quick help will be great.