Class DefaultPriceDataFactory
java.lang.Object
de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
- All Implemented Interfaces:
PriceDataFactory
Factory that creates PriceData instances for a price values. Includes a formatted price value.
-
Constructor Summary
Constructors -
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.create(PriceDataType priceType, BigDecimal value, CurrencyModel currency) Creates a PriceData object with a formatted currency string based on the price type and currency.create(PriceDataType priceType, BigDecimal value, String currencyIso) Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.protected NumberFormatcreateCurrencyFormat(Locale locale, CurrencyModel currency) protected NumberFormatcreateNumberFormat(Locale locale, CurrencyModel currency) protected PriceDataprotected StringformatPrice(BigDecimal value, CurrencyModel currency) protected CommerceCommonI18NServiceprotected CommonI18NServiceprotected I18NServicevoidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetI18NService(I18NService i18NService)
-
Constructor Details
-
DefaultPriceDataFactory
public DefaultPriceDataFactory()
-
-
Method Details
-
getCommerceCommonI18NService
-
setCommerceCommonI18NService
-
getI18NService
-
setI18NService
-
getCommonI18NService
-
setCommonI18NService
-
create
Description copied from interface:PriceDataFactoryCreates a PriceData object with a formatted currency string based on the price type and currency ISO code.- Specified by:
createin interfacePriceDataFactory- Parameters:
priceType- The price typevalue- The price amountcurrencyIso- The currency ISO code- Returns:
- the price data
-
create
Description copied from interface:PriceDataFactoryCreates a PriceData object with a formatted currency string based on the price type and currency.- Specified by:
createin interfacePriceDataFactory- Parameters:
priceType- The price typevalue- The price amountcurrency- The currency- Returns:
- the price data
-
formatPrice
-
createCurrencyFormat
- Parameters:
locale-currency-- 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. -
adjustSymbol
AdjustsDecimalFormat's symbol according to givenCurrencyModel. -
createPriceData
-