Class KiwiXmlConverters


  • public class KiwiXmlConverters
    extends Object
    Static utilities for converting to/from XML data types, e.g. XMLGregorianCalendar.
    • Constructor Detail

      • KiwiXmlConverters

        public KiwiXmlConverters()
    • Method Detail

      • newXMLGregorianCalendar

        public static XMLGregorianCalendar newXMLGregorianCalendar()
        Create a new XMLGregorianCalendar in the default time zone that is initialized to the current date/time.
        Returns:
        a new instance representing the current date/time
      • newXMLGregorianCalendarUTC

        public static XMLGregorianCalendar newXMLGregorianCalendarUTC()
        Create a new XMLGregorianCalendar in UTC that is initialized to the current date/time.
        Returns:
        a new instance representing the current date/time
      • newXMLGregorianCalendar

        public static XMLGregorianCalendar newXMLGregorianCalendar​(ZoneId zoneId)
        Create a new XMLGregorianCalendar in the given time zone that is initialized to the current date/time.
        Parameters:
        zoneId - the time zone for the new GregorianCalendar instance
        Returns:
        a new instance representing the current date/time
      • epochMillisToXMLGregorianCalendar

        public static XMLGregorianCalendar epochMillisToXMLGregorianCalendar​(long epochMillis)
        Converts milliseconds since the epoch to an XMLGregorianCalendar object in the default time zone.
        Parameters:
        epochMillis - number of milliseconds since the epoch
        Returns:
        a new instance representing the given number of epoch milliseconds
      • epochMillisToXMLGregorianCalendarUTC

        public static XMLGregorianCalendar epochMillisToXMLGregorianCalendarUTC​(long epochMillis)
        Converts milliseconds since the epoch to an XMLGregorianCalendar object in UTC.
        Parameters:
        epochMillis - number of milliseconds since the epoch
        Returns:
        a new instance representing the given number of epoch milliseconds
      • epochMillisToXMLGregorianCalendar

        public static XMLGregorianCalendar epochMillisToXMLGregorianCalendar​(long epochMillis,
                                                                             ZoneId zoneId)
        Converts milliseconds since the epoch to an XMLGregorianCalendar object in the given time zone.
        Parameters:
        epochMillis - number of milliseconds since the epoch
        zoneId - the time zone for the new GregorianCalendar instance
        Returns:
        a new instance representing the given number of epoch milliseconds
      • instantToXMLGregorianCalendar

        public static XMLGregorianCalendar instantToXMLGregorianCalendar​(Instant instant)
        Converts an Instant object to an XMLGregorianCalendar in the default time zone.
        Parameters:
        instant - the instant object to convert
        Returns:
        a new instance representing the given instant in time
      • instantToXMLGregorianCalendarUTC

        public static XMLGregorianCalendar instantToXMLGregorianCalendarUTC​(Instant instant)
        Converts an Instant object to an XMLGregorianCalendar in UTC.
        Parameters:
        instant - the instant object to convert
        Returns:
        a new instance representing the given instant in time
      • instantToXMLGregorianCalendar

        public static XMLGregorianCalendar instantToXMLGregorianCalendar​(Instant instant,
                                                                         ZoneId zoneId)
        Converts an Instant object to an XMLGregorianCalendar in the given time zone.
        Parameters:
        instant - the instant object to convert
        zoneId - the time zone for the new GregorianCalendar instance
        Returns:
        a new instance representing the given instant in time
      • dateToXMLGregorianCalendar

        public static XMLGregorianCalendar dateToXMLGregorianCalendar​(Date date)
        Converts a Date to an XMLGregorianCalendar in the default time zone.
        Parameters:
        date - the date object to convert
        Returns:
        a new instance representing the given date
      • dateToXMLGregorianCalendarUTC

        public static XMLGregorianCalendar dateToXMLGregorianCalendarUTC​(Date date)
        Converts a Date to an XMLGregorianCalendar in UTC.
        Parameters:
        date - the date object to convert
        Returns:
        a new instance representing the given date
      • dateToXMLGregorianCalendar

        public static XMLGregorianCalendar dateToXMLGregorianCalendar​(Date date,
                                                                      ZoneId zoneId)
        Converts a Date to an XMLGregorianCalendar in the given time zone.
        Parameters:
        date - the date object to convert
        zoneId - the time zone for the new GregorianCalendar instance
        Returns:
        a new instance representing the given date