psdi.util

Class MXNFormat

  • java.lang.Object
    • psdi.util.MXNFormat


  • public class MXNFormat
    extends java.lang.Object
    Class used for converting to and from the various data types supported in MAXIMO.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MXNFormat() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String dateTimeToParseString(java.util.Date d)
      Convert a date to a parse date time string using the default ULocale and time zone
      static java.lang.String dateTimeToParseString(java.util.Date d, com.ibm.icu.util.ULocale l)
      Convert a date to a parse datetime string using the specified locale and default time zone.
      static java.lang.String dateTimeToParseString(java.util.Date d, com.ibm.icu.util.ULocale l, com.ibm.icu.util.TimeZone tz)
      Convert a date to a parse datetime string using the specified locale and time zone.
      static java.lang.String dateTimeToSQLString(java.util.Date d)
      Convert a date to date time string of format yyyy-MM-dd HH:mm:ss for use in database queries.
      static java.lang.String dateTimeToString(java.util.Date d)
      Convert a date to a date time string using the default locale and time zone
      static java.lang.String dateTimeToString(java.util.Date d, com.ibm.icu.util.ULocale l)
      Convert a date to a datetime string using the specified locale and default time zone.
      static java.lang.String dateTimeToString(java.util.Date d, com.ibm.icu.util.ULocale l, java.util.TimeZone tz)
      Convert a date to a datetime string using the specified locale and time zone.
      static java.lang.String dateToSQLString(java.util.Date d)
      Convert a date to date time string of format yyyy-MM-dd for use in database queries.
      static java.lang.String dateToString(java.util.Date d)
      Convert a date to a string using the default ULocale and time zone.
      static java.lang.String dateToString(java.util.Date d, com.ibm.icu.util.ULocale l)
      Convert a date to string using the specidied ULocale and default time zone
      static java.lang.String dateToString(java.util.Date d, com.ibm.icu.util.ULocale l, java.util.TimeZone tz)
      Convert a date to a string using the specified ULocale and time zone.
      static java.util.Date getDateOnly(java.util.Date date)
      Set time portion of passed date to 00:00:00
      static int[] parseDateTime(java.lang.String s, com.ibm.icu.util.ULocale l, java.lang.String pattern)
      Break a date, datetime or time string into constituent parts.
      static void setSettingProp(java.lang.String propName, java.lang.String propValue)
      Save a value for setting property.
      static java.util.Date stringToDate(java.lang.String s)
      Convert a string to a date using the default locale amd default time zone
      static java.util.Date stringToDate(java.lang.String strDate, java.lang.String strFormat)
      Convert a string to date using the specidied format
      static java.util.Date stringToDate(java.lang.String s, com.ibm.icu.util.ULocale l)
      Convert a string to a date using the specified ULocale and default time zone
      static java.util.Date stringToDate(java.lang.String s, com.ibm.icu.util.ULocale l, java.util.TimeZone tz)
      Convert a string to a date using the specified ULocale and time zone
      static java.util.Date stringToDateTime(java.lang.String s)
      Convert a datetime string to a date using the default ULocale and time zone.
      static java.util.Date stringToDateTime(java.lang.String s, com.ibm.icu.util.ULocale l)
      Convert datetime string to a date using the specified ULocale and default time zone.
      static java.util.Date stringToDateTime(java.lang.String s, com.ibm.icu.util.ULocale l, java.util.TimeZone tz)
      Convet a datetime string to a date using the specified ULocale and time zone.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MXNFormat

        public MXNFormat()
    • Method Detail

      • stringToDate

        public static java.util.Date stringToDate(java.lang.String s,
                                                  com.ibm.icu.util.ULocale l)
                                           throws MXApplicationException
        Convert a string to a date using the specified ULocale and default time zone
        Throws:
        MXApplicationException
      • stringToDate

        public static java.util.Date stringToDate(java.lang.String s,
                                                  com.ibm.icu.util.ULocale l,
                                                  java.util.TimeZone tz)
                                           throws MXApplicationException
        Convert a string to a date using the specified ULocale and time zone
        Throws:
        MXApplicationException
      • stringToDate

        public static java.util.Date stringToDate(java.lang.String strDate,
                                                  java.lang.String strFormat)
                                           throws MXApplicationException
        Convert a string to date using the specidied format
        Throws:
        MXApplicationException
      • dateToString

        public static java.lang.String dateToString(java.util.Date d)
        Convert a date to a string using the default ULocale and time zone.
      • dateToString

        public static java.lang.String dateToString(java.util.Date d,
                                                    com.ibm.icu.util.ULocale l)
        Convert a date to string using the specidied ULocale and default time zone
      • dateToString

        public static java.lang.String dateToString(java.util.Date d,
                                                    com.ibm.icu.util.ULocale l,
                                                    java.util.TimeZone tz)
        Convert a date to a string using the specified ULocale and time zone.
      • stringToDateTime

        public static java.util.Date stringToDateTime(java.lang.String s)
                                               throws MXApplicationException
        Convert a datetime string to a date using the default ULocale and time zone.
        Throws:
        MXApplicationException
      • stringToDateTime

        public static java.util.Date stringToDateTime(java.lang.String s,
                                                      com.ibm.icu.util.ULocale l)
                                               throws MXApplicationException
        Convert datetime string to a date using the specified ULocale and default time zone.
        Throws:
        MXApplicationException
      • stringToDateTime

        public static java.util.Date stringToDateTime(java.lang.String s,
                                                      com.ibm.icu.util.ULocale l,
                                                      java.util.TimeZone tz)
                                               throws MXApplicationException
        Convet a datetime string to a date using the specified ULocale and time zone.
        Throws:
        MXApplicationException
      • dateTimeToParseString

        public static java.lang.String dateTimeToParseString(java.util.Date d)
        Convert a date to a parse date time string using the default ULocale and time zone
      • dateTimeToParseString

        public static java.lang.String dateTimeToParseString(java.util.Date d,
                                                             com.ibm.icu.util.ULocale l)
        Convert a date to a parse datetime string using the specified locale and default time zone.
      • dateTimeToParseString

        public static java.lang.String dateTimeToParseString(java.util.Date d,
                                                             com.ibm.icu.util.ULocale l,
                                                             com.ibm.icu.util.TimeZone tz)
        Convert a date to a parse datetime string using the specified locale and time zone.
      • dateTimeToString

        public static java.lang.String dateTimeToString(java.util.Date d)
        Convert a date to a date time string using the default locale and time zone
      • dateTimeToString

        public static java.lang.String dateTimeToString(java.util.Date d,
                                                        com.ibm.icu.util.ULocale l)
        Convert a date to a datetime string using the specified locale and default time zone.
      • dateTimeToString

        public static java.lang.String dateTimeToString(java.util.Date d,
                                                        com.ibm.icu.util.ULocale l,
                                                        java.util.TimeZone tz)
        Convert a date to a datetime string using the specified locale and time zone.
      • dateTimeToSQLString

        public static java.lang.String dateTimeToSQLString(java.util.Date d)
        Convert a date to date time string of format yyyy-MM-dd HH:mm:ss for use in database queries.
      • dateToSQLString

        public static java.lang.String dateToSQLString(java.util.Date d)
        Convert a date to date time string of format yyyy-MM-dd for use in database queries.
      • getDateOnly

        public static java.util.Date getDateOnly(java.util.Date date)
        Set time portion of passed date to 00:00:00
        Parameters:
        date -
        Returns:
        The same as the input date, but with time set to 00:00:00
      • parseDateTime

        public static int[] parseDateTime(java.lang.String s,
                                          com.ibm.icu.util.ULocale l,
                                          java.lang.String pattern)
                                   throws MXApplicationException
        Break a date, datetime or time string into constituent parts. Returns an array with containing values for day, month, year, hour, min, sec in that order.
        Throws:
        MXApplicationException
      • setSettingProp

        public static void setSettingProp(java.lang.String propName,
                                          java.lang.String propValue)
        Save a value for setting property. This should be called only by MaxPropCache. This method exists to support various static methods in MXFormat.
        Parameters:
        propName - Property name
        propValue - Property value