Class ConversionTools
java.lang.Object
de.hybris.platform.sap.sapcommonbol.transaction.util.impl.ConversionTools
Common conversion tools
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddLeadingZerosToNumericID(String inputString, int desiredLength) Method adds leading zeros to a numeric string based on a specified total lengthstatic StringcutOffZeros(String argument) Cuts of the leading zeros for document ID display and document item display.static StringgetDateFormat(Locale locale) Retrieves the date format pattern string for a given locale.static StringgetDecimalPointFormat(Locale locale) Retrieves the pattern string for the decimal point representation, using Java standard functionality.static chargetDecimalSeparator(Locale locale) Gets the decimal separator for a given locale, using Java standard functionality.static chargetGroupingSeparator(Locale locale) Gets the grouping separator for a given locale, using Java standard functionality.static StringgetR3LanguageCode(String langu) Return the single character r3 language code for a given String.static SimpleDateFormatRetrieves a new instance of SimpleDateFormat for the given locale.
-
Method Details
-
getDecimalPointFormat
Retrieves the pattern string for the decimal point representation, using Java standard functionality.- Parameters:
locale- the session locale- Returns:
- the pattern string
-
getDecimalSeparator
Gets the decimal separator for a given locale, using Java standard functionality.- Parameters:
locale- the current locale- Returns:
- the decimal separator
-
getGroupingSeparator
Gets the grouping separator for a given locale, using Java standard functionality.- Parameters:
locale- the current locale- Returns:
- the grouping separator
-
getDateFormat
Retrieves the date format pattern string for a given locale.- Parameters:
locale- the session loacale- Returns:
- the pattern string
-
getSDF
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
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
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
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
-