com.ibm.commerce.foundation.common.util.sdo

Class SDODataTypeHelper

  • java.lang.Object
    • com.ibm.commerce.foundation.common.util.sdo.SDODataTypeHelper


  • public class SDODataTypeHelper
    extends java.lang.Object
    Helper class for converting XML dates and times to and from Date objects.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String formatXMLDate(java.util.Date aDate)
      Formats a Date object into an XML date in the business context time zone.
      static java.lang.String formatXMLDateTime(java.util.Date aDate)
      Formats a Date object into an XML dateTime in the business context time zone.
      static java.lang.String formatXMLTime(java.util.Date aDate)
      Formats a Date object into an XML time in the business context time zone.
      static javax.xml.datatype.DatatypeFactory getDatatypeFactoryInstance()
      Returns an instance of the the data type factory.
      static java.util.Date getXMLDate(java.lang.Object obj)
      Parses an XML date into a Date object.
      static java.util.Date getXMLDateTime(java.lang.Object obj)
      Parses an XML dateTime into a Date object.
      static java.util.Date getXMLTime(java.lang.Object obj)
      Parses an XML time into a Date object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • getDatatypeFactoryInstance

        public static final javax.xml.datatype.DatatypeFactory getDatatypeFactoryInstance()
        Returns an instance of the the data type factory.
        Returns:
        an instance of the data type factory.
      • formatXMLDateTime

        public static java.lang.String formatXMLDateTime(java.util.Date aDate)
        Formats a Date object into an XML dateTime in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        aDate - the Date object.
        Returns:
        the XML dateTime.
      • formatXMLDate

        public static java.lang.String formatXMLDate(java.util.Date aDate)
        Formats a Date object into an XML date in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        aDate - the Date object.
        Returns:
        the XML date.
      • formatXMLTime

        public static java.lang.String formatXMLTime(java.util.Date aDate)
        Formats a Date object into an XML time in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        aDate - the Date object.
        Returns:
        the XML time.
      • getXMLDateTime

        public static java.util.Date getXMLDateTime(java.lang.Object obj)
        Parses an XML dateTime into a Date object. An XML dateTime with no time zone will be parsed as a local date and time in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        obj - SDO representation of the XML dateTime.
        Returns:
        the Date object.
      • getXMLDate

        public static java.util.Date getXMLDate(java.lang.Object obj)
        Parses an XML date into a Date object. An XML date with no time zone will be parsed as a local date in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        obj - SDO representation of the XML date.
        Returns:
        the Date object.
      • getXMLTime

        public static java.util.Date getXMLTime(java.lang.Object obj)
        Parses an XML time into a Date object. An XML date with no time zone will be parsed as a local time in the business context time zone. The business context time zone is specified using the business context data timeZoneId, which can be any ID accepted by TimeZone.getTimeZone(String). If not specified, the UTC time zone will be used.
        Parameters:
        obj - SDO representation of the XML time.
        Returns:
        the Date object.