Class ConversionTools
- java.lang.Object
-
- de.hybris.platform.sap.sapcommonbol.transaction.util.impl.ConversionTools
-
public class ConversionTools extends java.lang.ObjectCommon conversion tools
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringaddLeadingZerosToNumericID(java.lang.String inputString, int desiredLength)Method adds leading zeros to a numeric string based on a specified total lengthstatic java.lang.StringcutOffZeros(java.lang.String argument)Cuts of the leading zeros for document ID display and document item display.static java.lang.StringgetDateFormat(java.util.Locale locale)Retrieves the date format pattern string for a given locale.static java.lang.StringgetDecimalPointFormat(java.util.Locale locale)Retrieves the pattern string for the decimal point representation, using Java standard functionality.static chargetDecimalSeparator(java.util.Locale locale)Gets the decimal separator for a given locale, using Java standard functionality.static chargetGroupingSeparator(java.util.Locale locale)Gets the grouping separator for a given locale, using Java standard functionality.static java.lang.StringgetR3LanguageCode(java.lang.String langu)Return the single character r3 language code for a given String.static java.text.SimpleDateFormatgetSDF(java.util.Locale locale)Retrieves a new instance of SimpleDateFormat for the given locale.
-
-
-
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- aStringvalue- 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 StringdesiredLength- specifies the total desired length of the string- Returns:
- String with leading zeroes appended
-
-