Class DefaultTmaPriceValueFormatter
java.lang.Object
de.hybris.platform.b2ctelcofacades.price.impl.DefaultTmaPriceValueFormatter
- All Implemented Interfaces:
TmaPriceValueFormatter
Default implementation of the price value formatter.
- Since:
- 2007
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTmaPriceValueFormatter(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService, de.hybris.platform.commerceservices.i18n.CommerceCommonI18NService commerceCommonI18NService, de.hybris.platform.servicelayer.i18n.I18NService i18NService) -
Method Summary
Modifier and TypeMethodDescriptionprotected DecimalFormatadjustDigits(DecimalFormat format, CurrencyModel currencyModel) AdjustsDecimalFormat's fraction digits according to givenCurrencyModel.protected DecimalFormatadjustSymbol(DecimalFormat format, CurrencyModel currencyModel) AdjustsDecimalFormat's symbol according to givenCurrencyModel.protected NumberFormatcreateCurrencyFormat(Locale locale, CurrencyModel currency) Returns the currency formatted based on the given localeprotected NumberFormatcreateNumberFormat(Locale locale, CurrencyModel currency) formatPriceValue(BigDecimal value, CurrencyModel currency) Obtains a formatted string for the given price value and currency.protected de.hybris.platform.commerceservices.i18n.CommerceCommonI18NServiceprotected de.hybris.platform.servicelayer.i18n.CommonI18NServiceprotected de.hybris.platform.servicelayer.i18n.I18NService
-
Constructor Details
-
DefaultTmaPriceValueFormatter
public DefaultTmaPriceValueFormatter(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService, de.hybris.platform.commerceservices.i18n.CommerceCommonI18NService commerceCommonI18NService, de.hybris.platform.servicelayer.i18n.I18NService i18NService)
-
-
Method Details
-
formatPriceValue
Description copied from interface:TmaPriceValueFormatterObtains a formatted string for the given price value and currency.- Specified by:
formatPriceValuein interfaceTmaPriceValueFormatter- Parameters:
value- the price valuecurrency- the currency- Returns:
- formatted String with the price value and currency
-
createCurrencyFormat
Returns the currency formatted based on the given locale- Parameters:
locale- current locale which determines how the currency should be formatted.currency- currency which needs to be formatted- Returns:
- A clone of
NumberFormatfrom the instance in the local cache, if the cache does not contain an instance of a NumberFormat for a given locale and currency one would be added.
-
createNumberFormat
-
adjustDigits
AdjustsDecimalFormat's fraction digits according to givenCurrencyModel.- Parameters:
format- decimal format which needs to be adjusted based on the input currency.currencyModel- currency to be used in the formatting logic- Returns:
- adjusted value based on the given currency's digits.
-
adjustSymbol
AdjustsDecimalFormat's symbol according to givenCurrencyModel.- Parameters:
format- decimal format which needs to be adjusted based on the input currency.currencyModel- currency to be used in the formatting logic- Returns:
- adjusted value based on the given currency's symbol.
-
getCommonI18NService
protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService() -
getCommerceCommonI18NService
protected de.hybris.platform.commerceservices.i18n.CommerceCommonI18NService getCommerceCommonI18NService() -
getI18NService
protected de.hybris.platform.servicelayer.i18n.I18NService getI18NService()
-