List of utility methods to do XML Date Create
Date | toDate(XMLGregorianCalendar xmlCalendar) to Date Date retObj = null; if (xmlCalendar != null) { xmlCalendar.toGregorianCalendar().getTime(); return retObj; |
Date | toDate(XMLGregorianCalendar xmlGregorianCalendar) to Date if (null == xmlGregorianCalendar) { return null; GregorianCalendar gregorianCalendar = xmlGregorianCalendar.toGregorianCalendar(); return gregorianCalendar.getTime(); |
Function | toDateTime() to Date Time return xmlToJoda;
|
XMLGregorianCalendar | toDateTime(Date date) Convert a Java date to its XML date/time equivalent. GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date); return datatypeFactory().newXMLGregorianCalendar(cal).normalize(); |
XMLGregorianCalendar | toXMLCalendar(Date date) to XML Calendar GregorianCalendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(date.getTime()); return dataFactory.newXMLGregorianCalendar(calendar); |
XMLGregorianCalendar | toXmlDate(Date date) to Xml Date try { GregorianCalendar c = new GregorianCalendar(); c.setTime(date); return DatatypeFactory.newInstance().newXMLGregorianCalendar(c); } catch (DatatypeConfigurationException dtce) { throw new UnsupportedOperationException("Nemohu prevest " + "GregorianCalendar na XMLGregorianCalendar", dtce); |
XMLGregorianCalendar | toXMLDate(Date date) to XML Date final XMLGregorianCalendar gregCalendar = dataTypeFactory.newXMLGregorianCalendar(); final Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(date); gregCalendar.setYear(calendar.get(Calendar.YEAR)); gregCalendar.setMonth(calendar.get(Calendar.MONTH) + 1); gregCalendar.setDay(calendar.get(Calendar.DAY_OF_MONTH)); gregCalendar.setHour(calendar.get(Calendar.HOUR_OF_DAY)); gregCalendar.setMinute(calendar.get(Calendar.MINUTE)); ... |
XMLGregorianCalendar | toXmlDate(Date date) Returns a XMLGregorianCalender (xml:date) in current timezone based upon the given date only if (date != null) { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date); XMLGregorianCalendar xmlGregorianCalendar = factory.newXMLGregorianCalendar(cal); xmlGregorianCalendar.setHour(DatatypeConstants.FIELD_UNDEFINED); xmlGregorianCalendar.setMinute(DatatypeConstants.FIELD_UNDEFINED); xmlGregorianCalendar.setSecond(DatatypeConstants.FIELD_UNDEFINED); xmlGregorianCalendar.setMillisecond(DatatypeConstants.FIELD_UNDEFINED); ... |
XMLGregorianCalendar | toXmlDate(DateTime cal) Converts a DateTime to XMLGregorianCalendar . return datatypeFactory.newXMLGregorianCalendarDate(cal.getYear(), cal.getMonthOfYear(), cal.getDayOfMonth(),
DatatypeConstants.FIELD_UNDEFINED);
|
XMLGregorianCalendar | toXmlDate(GregorianCalendar date) to Xml Date try { return DatatypeFactory.newInstance().newXMLGregorianCalendar(date); } catch (DatatypeConfigurationException dtce) { throw new UnsupportedOperationException("Nemohu prevest " + "GregorianCalendar na XMLGregorianCalendar", dtce); |