Class ConversionTools


  • public class ConversionTools
    extends java.lang.Object
    Common conversion tools
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String addLeadingZerosToNumericID​(java.lang.String inputString, int desiredLength)
      Method adds leading zeros to a numeric string based on a specified total length
      static java.lang.String cutOffZeros​(java.lang.String argument)
      Cuts of the leading zeros for document ID display and document item display.
      static java.lang.String getDateFormat​(java.util.Locale locale)
      Retrieves the date format pattern string for a given locale.
      static java.lang.String getDecimalPointFormat​(java.util.Locale locale)
      Retrieves the pattern string for the decimal point representation, using Java standard functionality.
      static char getDecimalSeparator​(java.util.Locale locale)
      Gets the decimal separator for a given locale, using Java standard functionality.
      static char getGroupingSeparator​(java.util.Locale locale)
      Gets the grouping separator for a given locale, using Java standard functionality.
      static java.lang.String getR3LanguageCode​(java.lang.String langu)
      Return the single character r3 language code for a given String.
      static java.text.SimpleDateFormat getSDF​(java.util.Locale locale)
      Retrieves a new instance of SimpleDateFormat for the given locale.
      • Methods inherited from class java.lang.Object

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

      • getDecimalPointFormat

        public static java.lang.String getDecimalPointFormat​(java.util.Locale locale)
        Retrieves the pattern string for the decimal point representation, using Java standard functionality.
        Parameters:
        locale - the session locale
        Returns:
        the pattern string
      • getDecimalSeparator

        public static char getDecimalSeparator​(java.util.Locale locale)
        Gets the decimal separator for a given locale, using Java standard functionality.
        Parameters:
        locale - the current locale
        Returns:
        the decimal separator
      • getGroupingSeparator

        public static char getGroupingSeparator​(java.util.Locale locale)
        Gets the grouping separator for a given locale, using Java standard functionality.
        Parameters:
        locale - the current locale
        Returns:
        the grouping separator
      • getDateFormat

        public static java.lang.String getDateFormat​(java.util.Locale locale)
        Retrieves the date format pattern string for a given locale.
        Parameters:
        locale - the session loacale
        Returns:
        the pattern string
      • getSDF

        public static java.text.SimpleDateFormat getSDF​(java.util.Locale locale)
        Retrieves a new instance of SimpleDateFormat for the given locale. Note: Although the result is in short format, still 4 digits are displayed for year.
        Parameters:
        locale -
        Returns:
        new instance of date formatter.
      • cutOffZeros

        public static java.lang.String cutOffZeros​(java.lang.String argument)
        Cuts of the leading zeros for document ID display and document item display. If an format exception occurs, the input is returned.
        Parameters:
        argument - the String with leading zeros
        Returns:
        the String without leading zeros
      • getR3LanguageCode

        public static java.lang.String getR3LanguageCode​(java.lang.String langu)
        Return the single character r3 language code for a given String.
        Parameters:
        langu - a String value
        Returns:
        a the language in R/3 format. Case sensitive! value
      • addLeadingZerosToNumericID

        public static java.lang.String addLeadingZerosToNumericID​(java.lang.String inputString,
                                                                  int desiredLength)
        Method adds leading zeros to a numeric string based on a specified total length
        Parameters:
        inputString - contains the numeric String
        desiredLength - specifies the total desired length of the string
        Returns:
        String with leading zeroes appended