Java Utililty Methods XML Date to

List of utility methods to do XML Date to

Description

The list of methods to do XML Date to are organized into topic(s).

Method

DatecalendarAsDate(XMLGregorianCalendar xgc)
Converts an XMLGregorianCalendar to an instance of java.util.Date
if (xgc == null) {
    return null;
} else {
    return xgc.toGregorianCalendar().getTime();
StringcalendarAsString(XMLGregorianCalendar xgc)
calendar As String
return dateAsString(calendarAsDate(xgc));
DateconvertirXMLGregorianCalendarToDate(XMLGregorianCalendar fecha)
Convierte una fecha tipo XMLGregorianCalendar en un objeto Date
if (fecha == null) {
    return null;
Date date = null;
date = fecha.toGregorianCalendar().getTime();
return date;
DateTimeconvertSFTimeToDateTime(XMLGregorianCalendar soapTime)
Convert an XMLGregorianCalendar (assumed to be in UTC) into a DateTime .
return new DateTime(soapTime.getYear(), soapTime.getMonth(), soapTime.getDay(), soapTime.getHour(),
        soapTime.getMinute(), soapTime.getSecond(), soapTime.getMillisecond(), DateTimeZone.UTC);
ListconvertToDate(final List dates)
convert To Date
if (dates == null) {
    return null;
final List<Date> list = new ArrayList<Date>();
for (XMLGregorianCalendar date : dates) {
    list.add(convertToDate(date));
return list;
...
DateconvertToDate(XMLGregorianCalendar date)
Convert a XMLGregorianCalendar to a Date .
return date.toGregorianCalendar().getTime();
DateTimeconvertToDateTime(XMLGregorianCalendar calendar)
convert To Date Time
if (calendar == null) {
    return null;
return convertToLocalDateTime(calendar).toDateTime();
LocalTimeconvertToLocalTime(XMLGregorianCalendar calendar)
Converts from an XMLGregorianCalendar to a LocalTime i.e.
if (calendar == null) {
    return null;
int hour = calendar.getHour() > 0 ? calendar.getHour() : 0;
int minute = calendar.getMinute() > 0 ? calendar.getMinute() : 0;
int second = calendar.getSecond() > 0 ? calendar.getSecond() : 0;
int millisecond = calendar.getMillisecond() > 0 ? calendar.getMillisecond() : 0;
return new LocalTime(hour, minute, second, millisecond);
...
DateconvertXmlDateToDate(XMLGregorianCalendar date)
Converts a javax.xml.datatype.XMLGregorianCalendar to a java.util.Date.
return date.toGregorianCalendar().getTime();
DateconvertXmlGregCalToDate(XMLGregorianCalendar xmlCal)
convert Xml Greg Cal To Date
if (xmlCal == null) {
    return null;
return xmlCal.toGregorianCalendar().getTime();