psdi.util

Class MXFormat

  • java.lang.Object
    • psdi.util.MXFormat


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

      Constructors 
      Constructor and Description
      MXFormat() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String amountToString(double d)
      Convert a double to an amount string using the default locale.
      static java.lang.String amountToString(double d, int places)
      Convert a double to an amount string using the default locale.
      static java.lang.String amountToString(double d, int places, java.util.Locale l)
      Convert a double to an amount string using the specified locale.
      static byte[] blobToBytes(java.sql.Blob b)
      Convert a Blob to a byte array.
      static double booleanToDouble(boolean b)
      Converts a boolean value to a double value.
      static int booleanToInt(boolean b)
      Converts a boolean value to an int value.
      static long booleanToLong(boolean b)
      Converts a boolean value to a long value.
      static java.lang.String booleanToString(boolean b)
      Converts a boolean value to a string value.
      static java.lang.String booleanToString(boolean b, java.util.Locale l)
      Converts a boolean value to a string value.
      static java.lang.String clobToString(java.sql.Clob c)
      Convert a Clob to a string.
      static java.lang.String convertToStoreYNValue(java.lang.String val, java.util.Locale l)
      Converts the YORN value to Store YORN value
      static int dateTimePartToPosition(int tokennum, java.lang.String pattern)
      Returns the position of d,M,y,H,m,s for the pattern.
      static java.lang.String dateTimeToParseString(java.util.Date d)
      Convert a date to a parse date time string using the default locale and time zone
      static java.lang.String dateTimeToParseString(java.util.Date d, java.util.Locale 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, java.util.Locale l, java.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, java.util.Locale 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, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to a datetime string using the specified locale and time zone.
      static java.lang.String dateTimeToString(java.util.Date date, java.lang.String dateFormat, java.util.Locale l, java.util.TimeZone tz) 
      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 locale and time zone.
      static java.lang.String dateToString(java.util.Date d, java.util.Locale l)
      Convert a date to string using the specidied locale and default time zone
      static java.lang.String dateToString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to a string using the specified locale and time zone.
      static java.lang.String doubleToDuration(double d)
      Convert a double value to a duration string using the default locale
      static java.lang.String doubleToDuration(double d, java.util.Locale l)
      Convert a double value to a string using the specified locale.
      static java.lang.String doubleToString(double d)
      Convert a double to a string using the default locale
      static java.lang.String doubleToString(double d, int places)
      Convert a double to string, with a set number of decimal places.
      static java.lang.String doubleToString(double d, int places, java.util.Locale l)
      Convert a double to a string, setting the number of decimal places using the specified locale.
      static java.lang.String doubleToString(double d, int places, java.util.Locale l, boolean groupingInFormat)
      Convert a double to a string, setting the number of decimal places using the specified locale.
      static java.lang.String doubleToString(double d, java.util.Locale l)
      Conver a double to a string using the specified locale
      static double durationToDouble(java.lang.String s)
      Convert a duration string to a double value.
      static double durationToDouble(java.lang.String s, java.util.Locale l)
      Convert a duation string to a double value using the specified locale.
      static boolean formatHasTimeZone(java.lang.String format)
      Does this date/time format contain a time zone character.
      static java.lang.String formatRemoveTimeZone(java.lang.String format)
      Remove time zone characters from date/time format.
      static java.lang.String getAmountRegex(java.util.Locale locale)
      returns amount regex based on locale
      static java.util.Map getConvertedTypes()
      Get the string representation as in MAXTYPE domain of the maxtype by integer.
      static java.util.Date getDateOnly(java.util.Date date)
      Set time portion of passed date to 00:00:00
      static java.lang.String getDatePattern(java.util.Locale l)
      Returns the date pattern for UI framework.
      static java.util.Date getDateTimeHHMMOnly(java.util.Date date)
      Set seconds and milliseconds to 0.
      static java.lang.String getDateTimePattern(java.util.Locale l)
      Returns the parse date time pattern for UI framework.
      static java.lang.String getDisplayNoValue(java.util.Locale l)
      Get the display NO value from the locale properties file
      static java.lang.String getDisplayTimePattern(java.util.Locale l)
      Returns the parse time pattern for UI framework.
      static java.lang.String getDisplayYesValue(java.util.Locale l)
      Get the display YES value from the locale properties file
      static int getMaxTypeAsInt(java.lang.String type)
      Get the the MAXTYPE type as int value
      static java.util.Map getRepresentedTypes()
      Get the string representation as in MAXTYPE domain of the maxtype by integer.
      static java.lang.String getStoreNoValue()
      Get the store NO value from the database
      static java.lang.String getStoreYesValue()
      Get the store YES value from the database
      static java.lang.String getTimePattern(java.util.Locale l)
      Returns the parse time pattern for UI framework.
      static java.lang.String intToString(int i)
      Convert an integer to a string using the default locale.
      static java.lang.String intToString(int i, java.util.Locale l)
      convert an integer to a string using the specified locale.
      static boolean isTimePartEntered(java.lang.String s, java.util.Locale l)
      Helper method to find time part is entered in string or not.
      static boolean isValidChar(java.lang.String checkString)
      Checks to see if the input string contains valid characters for the database.
      static java.util.Date jmigStringToDateTime(java.lang.String s)
      Convert a dateTime String in ISO 8601 format to a Date object
      static java.lang.String longToString(long i)
      Convert a long to a string using the default locale.
      static java.lang.String longToString(long i, java.util.Locale l)
      convert a long to a string using the specified locale.
      static int[] parseDateTime(java.lang.String s, java.util.Locale 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 sqlWindowsStringToDateTime(java.lang.String s)
      Convert a string to a date using the specified locale and time zone
      static double stringToAmount(java.lang.String s)
      convert and amount string to a double using the default locale
      static double stringToAmount(java.lang.String s, java.util.Locale l)
      Convert and amount string to a double using the specified locale.
      static boolean stringToBoolean(java.lang.String s)
      Convert a string to a boolean value with default locale
      static boolean stringToBoolean(java.lang.String s, java.util.Locale l)
      Convert a string to a boolean value specific locale
      static java.lang.String stringToCodepoints(java.lang.String theString, boolean escapeSpace, boolean escapeUnicode)
      Converts unicodes to encoded \uxxxx and writes out any of the characters in specialSaveChars with a preceding slash
      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 s, java.util.Locale l)
      Convert a string to a date using the specified locale and default time zone
      static java.util.Date stringToDate(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convert a string to a date using the specified locale and 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 stringToDateTime(java.lang.String s)
      Convert a datetime string to a date using the default locale and time zone.
      static java.util.Date stringToDateTime(java.lang.String s, java.util.Locale l)
      Convert datetime string to a date using the specified locale and default time zone.
      static java.util.Date stringToDateTime(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convert a datetime string to a date using the specified locale and time zone.
      static double stringToDouble(java.lang.String s)
      Convert a string to a double using the default locale.
      static double stringToDouble(java.lang.String s, java.util.Locale l)
      convert a double to string using the specified locale
      static double stringToDouble(java.lang.String s, java.util.Locale l, boolean userUIMod)
      convert a string to double using the specified locale.
      static int stringToInt(java.lang.String s)
      Convert a string to an integer using the default locale
      static int stringToInt(java.lang.String s, java.util.Locale l)
      Convert a string to an integer using the specified locale
      static int stringToIntAsBindNumber(java.lang.String s)
      Convert a string to an integer expecting it to be the bind number in the sql statement.
      static long stringToLong(java.lang.String s)
      Convert a string to a long using the default locale
      static long stringToLong(java.lang.String s, java.util.Locale l)
      Convert a string to a long using the specified locale
      static java.util.Date stringToTime(java.lang.String s)
      Convert a time string to a date using the default locale and time zone.
      static java.util.Date stringToTime(java.lang.String s, java.util.Locale l)
      Convert a time string to a date using the specified locale and default time zone.
      static java.util.Date stringToTime(java.lang.String s, java.util.Locale l, java.util.TimeZone tz)
      Convert a time string to a date using the specified locale and time zone.
      static java.util.TimeZone stringToTimeZone(java.lang.String d, java.util.Locale l, java.lang.String timeFormat, java.util.TimeZone defaultTZ)
      Parse the Date string and return the time zone.
      static boolean supports24Hours(java.util.Locale l)
      Returns if Parse time is 24 hour format or not.
      static java.lang.String timeToParseString(java.util.Date d, java.util.Locale l)
      Convert a date to a parse time string using the specified locale and default time zone.
      static java.lang.String timeToParseString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to parse time string using the specified locale and time zone.
      static java.lang.String timeToParsetring(java.util.Date d)
      Convert a date to a parse time string using the default locale and time zone.
      static java.lang.String timeToSQLString(java.util.Date d)
      Convert a date to time string of format HH:mm:ss for use in database queries.
      static java.lang.String timeToString(java.util.Date d)
      Convert a date to a time string using the default locale and time zone.
      static java.lang.String timeToString(java.util.Date d, java.util.Locale l)
      Convert a date to a time string using the specified locale and default time zone.
      static java.lang.String timeToString(java.util.Date d, java.util.Locale l, java.util.TimeZone tz)
      Convert a date to time string using the specified locale and time zone.
      static char toHex(int nibble)
      Convert a nibble to a hex character
      static boolean validateAmountAgainstLocaleFormat(java.lang.String s, java.util.Locale l) 
      static boolean validateDoubleAgainstLocaleFormat(java.lang.String s, java.util.Locale l) 
      static boolean validateEnteredValueAgainstLocaleFormat(java.lang.String s, java.util.Locale l, java.lang.String regEx) 
      static boolean validateFloatAgainstLocaleFormat(java.lang.String s, java.util.Locale l) 
      • Methods inherited from class java.lang.Object

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

      • MXFormat

        public MXFormat()
    • Method Detail

      • validateDoubleAgainstLocaleFormat

        public static boolean validateDoubleAgainstLocaleFormat(java.lang.String s,
                                                                java.util.Locale l)
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateAmountAgainstLocaleFormat

        public static boolean validateAmountAgainstLocaleFormat(java.lang.String s,
                                                                java.util.Locale l)
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateFloatAgainstLocaleFormat

        public static boolean validateFloatAgainstLocaleFormat(java.lang.String s,
                                                               java.util.Locale l)
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateEnteredValueAgainstLocaleFormat

        public static boolean validateEnteredValueAgainstLocaleFormat(java.lang.String s,
                                                                      java.util.Locale l,
                                                                      java.lang.String regEx)
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAmountRegex

        public static java.lang.String getAmountRegex(java.util.Locale locale)
        returns amount regex based on locale
      • stringToIntAsBindNumber

        public static int stringToIntAsBindNumber(java.lang.String s)
                                           throws MXApplicationException
        Convert a string to an integer expecting it to be the bind number in the sql statement. This should be used instead of stringToInt() if the call is to test whether the string is a bind number in a sql. The method does not throw exception. It returns -1 if it is not a bind number
        Throws:
        MXApplicationException
      • intToString

        public static java.lang.String intToString(int i)
        Convert an integer to a string using the default locale. This will place locale specific characters in the returned string.
      • intToString

        public static java.lang.String intToString(int i,
                                                   java.util.Locale l)
        convert an integer to a string using the specified locale.
      • longToString

        public static java.lang.String longToString(long i)
        Convert a long to a string using the default locale. This will place locale specific characters in the returned string.
      • longToString

        public static java.lang.String longToString(long i,
                                                    java.util.Locale l)
        convert a long to a string using the specified locale.
      • stringToAmount

        public static double stringToAmount(java.lang.String s,
                                            java.util.Locale l)
                                     throws MXApplicationException
        Convert and amount string to a double using the specified locale.
        Throws:
        MXApplicationException
      • amountToString

        public static java.lang.String amountToString(double d)
        Convert a double to an amount string using the default locale. Returned string will contain currency symbol and locale specific grouping characters.
      • amountToString

        public static java.lang.String amountToString(double d,
                                                      int places)
        Convert a double to an amount string using the default locale.
      • amountToString

        public static java.lang.String amountToString(double d,
                                                      int places,
                                                      java.util.Locale l)
        Convert a double to an amount string using the specified locale.
      • stringToDouble

        public static double stringToDouble(java.lang.String s,
                                            java.util.Locale l,
                                            boolean userUIMod)
                                     throws MXApplicationException
        convert a string to double using the specified locale. This method considers whether the string has been entered in the UI.
        Throws:
        MXApplicationException
      • doubleToString

        public static java.lang.String doubleToString(double d)
        Convert a double to a string using the default locale
      • doubleToString

        public static java.lang.String doubleToString(double d,
                                                      java.util.Locale l)
        Conver a double to a string using the specified locale
      • doubleToString

        public static java.lang.String doubleToString(double d,
                                                      int places)
        Convert a double to string, with a set number of decimal places. This uses the default locale.
      • doubleToString

        public static java.lang.String doubleToString(double d,
                                                      int places,
                                                      java.util.Locale l)
        Convert a double to a string, setting the number of decimal places using the specified locale.
      • doubleToString

        public static java.lang.String doubleToString(double d,
                                                      int places,
                                                      java.util.Locale l,
                                                      boolean groupingInFormat)
        Convert a double to a string, setting the number of decimal places using the specified locale.
      • durationToDouble

        public static double durationToDouble(java.lang.String s)
                                       throws MXApplicationException
        Convert a duration string to a double value. The string can either be of the format hh:mm:ss or 999.99. The default locale is used.
        Throws:
        MXApplicationException
      • durationToDouble

        public static double durationToDouble(java.lang.String s,
                                              java.util.Locale l)
                                       throws MXApplicationException
        Convert a duation string to a double value using the specified locale.
        Throws:
        MXApplicationException
      • doubleToDuration

        public static java.lang.String doubleToDuration(double d)
        Convert a double value to a duration string using the default locale
      • doubleToDuration

        public static java.lang.String doubleToDuration(double d,
                                                        java.util.Locale l)
        Convert a double value to a string using the specified locale.
      • booleanToString

        public static java.lang.String booleanToString(boolean b)
        Converts a boolean value to a string value. Uses the Y/N character representations of default locale
      • booleanToString

        public static java.lang.String booleanToString(boolean b,
                                                       java.util.Locale l)
        Converts a boolean value to a string value. Uses the Y/N character representations from locale file
      • booleanToInt

        public static int booleanToInt(boolean b)
        Converts a boolean value to an int value.
      • booleanToDouble

        public static double booleanToDouble(boolean b)
        Converts a boolean value to a double value.
      • booleanToLong

        public static long booleanToLong(boolean b)
        Converts a boolean value to a long value.
      • stringToDate

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

        public static java.util.Date stringToDate(java.lang.String s,
                                                  java.util.Locale l,
                                                  java.util.TimeZone tz)
                                           throws MXApplicationException
        Convert a string to a date using the specified locale 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
      • dateTimeToString

        public static java.lang.String dateTimeToString(java.util.Date date,
                                                        java.lang.String dateFormat,
                                                        java.util.Locale l,
                                                        java.util.TimeZone tz)
                                                 throws MXApplicationException
        Throws:
        MXApplicationException
      • sqlWindowsStringToDateTime

        public static java.util.Date sqlWindowsStringToDateTime(java.lang.String s)
                                                         throws MXApplicationException
        Convert a string to a date using the specified locale and time zone
        Throws:
        MXApplicationException
      • jmigStringToDateTime

        public static java.util.Date jmigStringToDateTime(java.lang.String s)
                                                   throws MXApplicationException
        Convert a dateTime String in ISO 8601 format to a Date object
        Parameters:
        s - the dateTime String
        Returns:
        the converted Date object
        Throws:
        MXApplicationException
      • dateToString

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

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

        public static java.lang.String dateToString(java.util.Date d,
                                                    java.util.Locale l,
                                                    java.util.TimeZone tz)
        Convert a date to a string using the specified locale 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 locale and time zone.
        Throws:
        MXApplicationException
      • stringToDateTime

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

        public static java.util.Date stringToDateTime(java.lang.String s,
                                                      java.util.Locale l,
                                                      java.util.TimeZone tz)
                                               throws MXApplicationException
        Convert a datetime string to a date using the specified locale 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 locale and time zone
      • dateTimeToParseString

        public static java.lang.String dateTimeToParseString(java.util.Date d,
                                                             java.util.Locale 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,
                                                             java.util.Locale l,
                                                             java.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,
                                                        java.util.Locale 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,
                                                        java.util.Locale 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.
      • timeToSQLString

        public static java.lang.String timeToSQLString(java.util.Date d)
        Convert a date to time string of format HH:mm:ss for use in database queries.
      • stringToTime

        public static java.util.Date stringToTime(java.lang.String s,
                                                  java.util.Locale l)
                                           throws MXApplicationException
        Convert a time string to a date using the specified locale and default time zone.
        Throws:
        MXApplicationException
      • stringToTime

        public static java.util.Date stringToTime(java.lang.String s,
                                                  java.util.Locale l,
                                                  java.util.TimeZone tz)
                                           throws MXApplicationException
        Convert a time string to a date using the specified locale and time zone.
        Throws:
        MXApplicationException
      • timeToParsetring

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

        public static java.lang.String timeToParseString(java.util.Date d,
                                                         java.util.Locale l)
        Convert a date to a parse time string using the specified locale and default time zone.
      • timeToParseString

        public static java.lang.String timeToParseString(java.util.Date d,
                                                         java.util.Locale l,
                                                         java.util.TimeZone tz)
        Convert a date to parse time string using the specified locale and time zone.
      • timeToString

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

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

        public static java.lang.String timeToString(java.util.Date d,
                                                    java.util.Locale l,
                                                    java.util.TimeZone tz)
        Convert a date to time string using the specified locale and time zone.
      • 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
      • getDateTimeHHMMOnly

        public static java.util.Date getDateTimeHHMMOnly(java.util.Date date)
        Set seconds and milliseconds to 0.
        Parameters:
        date -
        Returns:
        Input date with seconds and milliseconds set to zero.
      • getMaxTypeAsInt

        public static int getMaxTypeAsInt(java.lang.String type)
        Get the the MAXTYPE type as int value
      • parseDateTime

        public static int[] parseDateTime(java.lang.String s,
                                          java.util.Locale 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
      • isTimePartEntered

        public static boolean isTimePartEntered(java.lang.String s,
                                                java.util.Locale l)
        Helper method to find time part is entered in string or not. Must be called for a valid datetime string.
        Parameters:
        s -
        l -
        pattern -
        Returns:
      • getStoreYesValue

        public static java.lang.String getStoreYesValue()
        Get the store YES value from the database
        Returns:
        yes value
      • getStoreNoValue

        public static java.lang.String getStoreNoValue()
        Get the store NO value from the database
        Returns:
        no value
      • getDisplayYesValue

        public static java.lang.String getDisplayYesValue(java.util.Locale l)
        Get the display YES value from the locale properties file
      • getDisplayNoValue

        public static java.lang.String getDisplayNoValue(java.util.Locale l)
        Get the display NO value from the locale properties file
      • convertToStoreYNValue

        public static java.lang.String convertToStoreYNValue(java.lang.String val,
                                                             java.util.Locale l)
                                                      throws MXException
        Converts the YORN value to Store YORN value
        Throws:
        MXException
      • clobToString

        public static java.lang.String clobToString(java.sql.Clob c)
        Convert a Clob to a string.
        Parameters:
        c - Clob
        Returns:
        Clob value as String
      • blobToBytes

        public static byte[] blobToBytes(java.sql.Blob b)
        Convert a Blob to a byte array.
        Parameters:
        b - Blob
        Returns:
        Blob value as byte[]
      • getDatePattern

        public static java.lang.String getDatePattern(java.util.Locale l)
        Returns the date pattern for UI framework.
        Parameters:
        l -
        t -
        Returns:
        pattern
      • getTimePattern

        public static java.lang.String getTimePattern(java.util.Locale l)
        Returns the parse time pattern for UI framework.
        Parameters:
        l -
        t -
        Returns:
        pattern
      • getDisplayTimePattern

        public static java.lang.String getDisplayTimePattern(java.util.Locale l)
        Returns the parse time pattern for UI framework.
        Parameters:
        l -
        t -
        Returns:
        pattern
      • getDateTimePattern

        public static java.lang.String getDateTimePattern(java.util.Locale l)
        Returns the parse date time pattern for UI framework.
        Parameters:
        l -
        t -
        Returns:
        pattern
      • supports24Hours

        public static boolean supports24Hours(java.util.Locale l)
        Returns if Parse time is 24 hour format or not.
        Parameters:
        l -
        Returns:
      • dateTimePartToPosition

        public static int dateTimePartToPosition(int tokennum,
                                                 java.lang.String pattern)
        Returns the position of d,M,y,H,m,s for the pattern.
        Parameters:
        tokennum - 0 - day, 1- month, 2- year, 3- hour, 4 -minute, 5 - second
        pattern -
        Returns:
        position starts with 0
      • stringToCodepoints

        public static java.lang.String stringToCodepoints(java.lang.String theString,
                                                          boolean escapeSpace,
                                                          boolean escapeUnicode)
        Converts unicodes to encoded \uxxxx and writes out any of the characters in specialSaveChars with a preceding slash
        Parameters:
        String - - the string to convert into code points.
        escapeSpace - - flag for escpaing space in the string
        escapeUnicode - - flag for escaping the slah in the unicode codepoint (For browser script/HTML)
        Returns:
        String - codepoints for every character in the string passed
      • 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
      • toHex

        public static char toHex(int nibble)
        Convert a nibble to a hex character
        Parameters:
        nibble - the nibble to convert.
        Returns:
        hexdigits char for the int nibble
      • isValidChar

        public static boolean isValidChar(java.lang.String checkString)
        Checks to see if the input string contains valid characters for the database. A-Z, 0-9, _, and $ are valid. The first character cannot equal _ or $.
        Parameters:
        checkString - the string to be checked
        Returns:
        True if valid, else False
      • getConvertedTypes

        public static java.util.Map getConvertedTypes()
        Get the string representation as in MAXTYPE domain of the maxtype by integer. Returns null if it is an unknown type.
        Parameters:
        i -
        Returns:
      • getRepresentedTypes

        public static java.util.Map getRepresentedTypes()
        Get the string representation as in MAXTYPE domain of the maxtype by integer. Returns null if it is an unknown type.
        Parameters:
        i -
        Returns:
      • formatHasTimeZone

        public static boolean formatHasTimeZone(java.lang.String format)
        Does this date/time format contain a time zone character.
        Parameters:
        format -
        Returns:
        boolean
      • formatRemoveTimeZone

        public static java.lang.String formatRemoveTimeZone(java.lang.String format)
        Remove time zone characters from date/time format.
        Parameters:
        format - Date/Time format string
        Returns:
      • stringToTimeZone

        public static java.util.TimeZone stringToTimeZone(java.lang.String d,
                                                          java.util.Locale l,
                                                          java.lang.String timeFormat,
                                                          java.util.TimeZone defaultTZ)
        Parse the Date string and return the time zone. Returns the default time zone if unable to extract time zone data from the Date string.
        Parameters:
        d - Date String
        l - Locale
        timeFormat - Date/Time format string
        defaultTZ - Default Time Zone
        Returns:
        TimeZone