This is the first time I am working this intensly with XML in Java. The code uses JAXB to generate classes and then parse. I have an XML with a date...
A class was generated by JAXB from my XML. It generated the following for the field:
@XmlElement(name = "CoverStartDate", required = true)
protected XMLGregorianCalendar coverStartDate;
In my logic I have the following
xxxx.setCoverStartDate(xmlGregorianCalendar(theDate)
There is a method xmlGregorianCalendar which looks something like this:
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTime(date);
return DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
My return XML that is generated, had the date with a time specified. I only want the date (year-month-day).
Any suggestions?
Thanks