Class ConversionHelper


  • public class ConversionHelper
    extends java.lang.Object
    Helper class for the data conversion for the Jco calls.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_TIMEZONE
      Time zone which is used as default.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigDecimal adjustCurrencyDecimalPoint​(java.math.BigDecimal value, int decimal)
      Adjusts the BigDecimal from JCo value to the correct customized one.
      static java.lang.String convertBigDecimalToString​(java.math.BigDecimal bd)
      Converts a BigDecimal to a String using the Locale defined in LocaleUtil.
      static java.util.Date convertDateStringToDate​(java.lang.String datsAsString)
      Converts a date string in format yyyyMMdd to a date.
      static java.lang.String convertDateToDateString​(java.util.Date date)
      Converts a date into a date string in format yyyyMMdd .
      static java.lang.String convertDateToLocalizedString​(java.util.Date date)
      Converts a date into a localized date string (which is formatted according to the session locale)
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_TIMEZONE

        public static final java.lang.String DEFAULT_TIMEZONE
        Time zone which is used as default.
        See Also:
        Constant Field Values
    • Method Detail

      • convertDateStringToDate

        public static java.util.Date convertDateStringToDate​(java.lang.String datsAsString)
        Converts a date string in format yyyyMMdd to a date.
        Parameters:
        datsAsString - date string in format yyyyMMdd
        Returns:
        date
      • convertDateToDateString

        public static java.lang.String convertDateToDateString​(java.util.Date date)
        Converts a date into a date string in format yyyyMMdd .
        Parameters:
        date - in date string format
        Returns:
        date string in format yyyyMMdd
      • convertDateToLocalizedString

        public static java.lang.String convertDateToLocalizedString​(java.util.Date date)
        Converts a date into a localized date string (which is formatted according to the session locale)
        Parameters:
        date - Date in date format
        Returns:
        localised date string
      • convertBigDecimalToString

        public static java.lang.String convertBigDecimalToString​(java.math.BigDecimal bd)
        Converts a BigDecimal to a String using the Locale defined in LocaleUtil. The fraction length is kept from the BigDecimal.
        Parameters:
        bd - Big decimal
        Returns:
        String like "0.00"
      • adjustCurrencyDecimalPoint

        public static java.math.BigDecimal adjustCurrencyDecimalPoint​(java.math.BigDecimal value,
                                                                      int decimal)
        Adjusts the BigDecimal from JCo value to the correct customized one.
        Parameters:
        value - BigDecimal from JCO
        decimal - customized number of decimals
        Returns:
        corrected BigDecimal