private String stringFromXMLGregorianCalendar(XMLGregorianCalendar cal, QName schemaTypeQName) { return stringFromCalendar(cal.toGregorianCalendar(), schemaTypeQName); }
private String stringFromCalendar(Calendar sourceCalendar) { if (!(sourceCalendar.isSet(Calendar.HOUR) || sourceCalendar.isSet(Calendar.MINUTE) || sourceCalendar.isSet(Calendar.SECOND) || sourceCalendar.isSet(Calendar.MILLISECOND))) { return stringFromCalendar(sourceCalendar, Constants.DATE_QNAME); } else if (!(sourceCalendar.isSet(Calendar.YEAR) || sourceCalendar.isSet(Calendar.MONTH) || sourceCalendar.isSet(Calendar.DATE))) { return stringFromCalendar(sourceCalendar, Constants.TIME_QNAME); } else { return stringFromCalendar(sourceCalendar, Constants.DATE_TIME_QNAME); } }
private String stringFromCalendar(Calendar sourceCalendar) { if (!(sourceCalendar.isSet(Calendar.HOUR) || sourceCalendar.isSet(Calendar.MINUTE) || sourceCalendar.isSet(Calendar.SECOND) || sourceCalendar.isSet(Calendar.MILLISECOND))) { return stringFromCalendar(sourceCalendar, Constants.DATE_QNAME); } else if (!(sourceCalendar.isSet(Calendar.YEAR) || sourceCalendar.isSet(Calendar.MONTH) || sourceCalendar.isSet(Calendar.DATE))) { return stringFromCalendar(sourceCalendar, Constants.TIME_QNAME); } else { return stringFromCalendar(sourceCalendar, Constants.DATE_TIME_QNAME); } }
private String stringFromXMLGregorianCalendar(XMLGregorianCalendar cal, QName schemaTypeQName) { if(schemaTypeQName !=null && schemaTypeQName.equals(cal.getXMLSchemaType()) && schemaTypeQName != Constants.G_MONTH_QNAME){ return cal.toXMLFormat(); } GregorianCalendar gCal = cal.toGregorianCalendar(); if(cal.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) { gCal.clear(Calendar.ZONE_OFFSET); } return stringFromCalendar(gCal, schemaTypeQName); }
private String stringFromXMLGregorianCalendar(XMLGregorianCalendar cal, QName schemaTypeQName) { if(schemaTypeQName !=null && schemaTypeQName.equals(cal.getXMLSchemaType()) && schemaTypeQName != Constants.G_MONTH_QNAME){ return cal.toXMLFormat(); } GregorianCalendar gCal = cal.toGregorianCalendar(); if(cal.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) { gCal.clear(Calendar.ZONE_OFFSET); } return stringFromCalendar(gCal, schemaTypeQName); }
private String stringFromCalendar(Calendar sourceCalendar) { if (!(sourceCalendar.isSet(Calendar.HOUR) || sourceCalendar.isSet(Calendar.MINUTE) || sourceCalendar.isSet(Calendar.SECOND) || sourceCalendar.isSet(Calendar.MILLISECOND))) { return stringFromCalendar(sourceCalendar, XMLConstants.DATE_QNAME); } else if (!(sourceCalendar.isSet(Calendar.YEAR) || sourceCalendar.isSet(Calendar.MONTH) || sourceCalendar.isSet(Calendar.DATE))) { return stringFromCalendar(sourceCalendar, XMLConstants.TIME_QNAME); } else { return stringFromDate(sourceCalendar.getTime()); } }
/** * Convert from a Calendar to a String representation of the DateTime type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the DateTime type. */ public String toDateTime(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.DATE_TIME_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Year type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Year type. */ public String toYear(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_YEAR_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the YearMonth type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the YearMonth type. */ public String toYearMonth(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_YEAR_MONTH_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the YearMonthDay * type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the YearMonthDay type. */ public String toYearMonthDay(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.DATE_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Time type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Time type. */ public String toTime(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.TIME_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the DateTime type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the DateTime type. */ public String toDateTime(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.DATE_TIME_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Year type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Year type. */ public String toYear(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_YEAR_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the YearMonth type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the YearMonth type. */ public String toYearMonth(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_YEAR_MONTH_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Month type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Month type. */ public String toMonth(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_MONTH_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Time type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Time type. */ public String toTime(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.TIME_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Day type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Day type. */ public String toDay(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_DAY_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Month type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Month type. */ public String toMonth(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_MONTH_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the Day type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the Day type. */ public String toDay(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.G_DAY_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }
/** * Convert from a Calendar to a String representation of the YearMonthDay * type. * * @param calendar the calendar to convert * @return a Calendar to a String representation of the YearMonthDay type. */ public String toYearMonthDay(Calendar calendar) { if (calendar == null) { return null; } // Temporarily turn off TZ qualification boolean wasTimezoneQualified = getXMLConversionManager().isTimeZoneQualified(); getXMLConversionManager().setTimeZoneQualified(false); String s = getXMLConversionManager().stringFromCalendar(calendar, XMLConstants.DATE_QNAME); getXMLConversionManager().setTimeZoneQualified(wasTimezoneQualified); return s; }