Class DefaultPriceDataFactory
- java.lang.Object
-
- de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
-
- All Implemented Interfaces:
PriceDataFactory
public class DefaultPriceDataFactory extends java.lang.Object implements PriceDataFactory
Factory that creates PriceData instances for a price values. Includes a formatted price value.
-
-
Constructor Summary
Constructors Constructor Description DefaultPriceDataFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.text.DecimalFormatadjustDigits(java.text.DecimalFormat format, CurrencyModel currencyModel)AdjustsDecimalFormat's fraction digits according to givenCurrencyModel.protected java.text.DecimalFormatadjustSymbol(java.text.DecimalFormat format, CurrencyModel currencyModel)AdjustsDecimalFormat's symbol according to givenCurrencyModel.PriceDatacreate(PriceDataType priceType, java.math.BigDecimal value, CurrencyModel currency)Creates a PriceData object with a formatted currency string based on the price type and currency.PriceDatacreate(PriceDataType priceType, java.math.BigDecimal value, java.lang.String currencyIso)Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.protected java.text.NumberFormatcreateCurrencyFormat(java.util.Locale locale, CurrencyModel currency)protected java.text.NumberFormatcreateNumberFormat(java.util.Locale locale, CurrencyModel currency)protected PriceDatacreatePriceData()protected java.lang.StringformatPrice(java.math.BigDecimal value, CurrencyModel currency)protected CommerceCommonI18NServicegetCommerceCommonI18NService()protected CommonI18NServicegetCommonI18NService()protected I18NServicegetI18NService()voidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetI18NService(I18NService i18NService)
-
-
-
Method Detail
-
getCommerceCommonI18NService
protected CommerceCommonI18NService getCommerceCommonI18NService()
-
setCommerceCommonI18NService
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
-
getI18NService
protected I18NService getI18NService()
-
setI18NService
public void setI18NService(I18NService i18NService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
create
public PriceData create(PriceDataType priceType, java.math.BigDecimal value, java.lang.String currencyIso)
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
public PriceData create(PriceDataType priceType, java.math.BigDecimal value, CurrencyModel currency)
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
protected java.lang.String formatPrice(java.math.BigDecimal value, CurrencyModel currency)
-
createCurrencyFormat
protected java.text.NumberFormat createCurrencyFormat(java.util.Locale locale, CurrencyModel currency)- 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
protected java.text.NumberFormat createNumberFormat(java.util.Locale locale, CurrencyModel currency)
-
adjustDigits
protected java.text.DecimalFormat adjustDigits(java.text.DecimalFormat format, CurrencyModel currencyModel)AdjustsDecimalFormat's fraction digits according to givenCurrencyModel.
-
adjustSymbol
protected java.text.DecimalFormat adjustSymbol(java.text.DecimalFormat format, CurrencyModel currencyModel)AdjustsDecimalFormat's symbol according to givenCurrencyModel.
-
createPriceData
protected PriceData createPriceData()
-
-