Class DefaultCommerceCommonI18NService
- java.lang.Object
-
- de.hybris.platform.commerceservices.i18n.impl.DefaultCommerceCommonI18NService
-
- All Implemented Interfaces:
CommerceCommonI18NService
public class DefaultCommerceCommonI18NService extends java.lang.Object implements CommerceCommonI18NService
Implementation forCommerceCommonI18NService
. Class also extendsDefaultCommonI18NService
to provide currency and language -related methods.
-
-
Constructor Summary
Constructors Constructor Description DefaultCommerceCommonI18NService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Locale
createLocale(java.lang.String localeString)
java.util.Collection<CountryModel>
getAllCountries()
Method for getting list of countries stored as a catalog version property.java.util.List<CurrencyModel>
getAllCurrencies()
Method for getting all currencies for the current store.java.util.Collection<LanguageModel>
getAllLanguages()
Method for getting list of languages stored as a catalog version property.protected BaseSiteService
getBaseSiteService()
protected BaseStoreService
getBaseStoreService()
protected CommonI18NService
getCommonI18NService()
CurrencyModel
getCurrentCurrency()
Get the current currencyLanguageModel
getCurrentLanguage()
Get the current languagejava.util.Locale
getCurrentLocale()
Get the current localeCurrencyModel
getDefaultCurrency()
Method for getting the default currency for the current store.LanguageModel
getDefaultLanguage()
Method for getting the default language for the current store.protected I18NService
getI18nService()
java.util.Locale
getLocaleForLanguage(LanguageModel language)
Get the site specific locale for the specified languageprotected java.util.Map<java.lang.String,java.util.Locale>
getLocales()
void
setBaseSiteService(BaseSiteService baseSiteService)
void
setBaseStoreService(BaseStoreService baseStoreService)
void
setCommonI18NService(CommonI18NService commonI18NService)
void
setCurrentCurrency(CurrencyModel currency)
Set current currency.void
setCurrentLanguage(LanguageModel language)
Set current language.void
setI18nService(I18NService i18nService)
-
-
-
Method Detail
-
getAllCurrencies
public java.util.List<CurrencyModel> getAllCurrencies()
Description copied from interface:CommerceCommonI18NService
Method for getting all currencies for the current store.- Specified by:
getAllCurrencies
in interfaceCommerceCommonI18NService
- Returns:
- list of currencies supported.
-
getAllLanguages
public java.util.Collection<LanguageModel> getAllLanguages()
Description copied from interface:CommerceCommonI18NService
Method for getting list of languages stored as a catalog version property.- Specified by:
getAllLanguages
in interfaceCommerceCommonI18NService
- Returns:
- list of languages supported.
-
getDefaultLanguage
public LanguageModel getDefaultLanguage()
Description copied from interface:CommerceCommonI18NService
Method for getting the default language for the current store.- Specified by:
getDefaultLanguage
in interfaceCommerceCommonI18NService
- Returns:
- the default language.
-
getDefaultCurrency
public CurrencyModel getDefaultCurrency()
Description copied from interface:CommerceCommonI18NService
Method for getting the default currency for the current store.- Specified by:
getDefaultCurrency
in interfaceCommerceCommonI18NService
- Returns:
- the default currency.
-
getAllCountries
public java.util.Collection<CountryModel> getAllCountries()
Description copied from interface:CommerceCommonI18NService
Method for getting list of countries stored as a catalog version property.- Specified by:
getAllCountries
in interfaceCommerceCommonI18NService
- Returns:
- list of countries supported.
-
getCurrentCurrency
public CurrencyModel getCurrentCurrency()
Description copied from interface:CommerceCommonI18NService
Get the current currency- Specified by:
getCurrentCurrency
in interfaceCommerceCommonI18NService
- Returns:
- the current currency
-
setCurrentCurrency
public void setCurrentCurrency(CurrencyModel currency)
Description copied from interface:CommerceCommonI18NService
Set current currency.- Specified by:
setCurrentCurrency
in interfaceCommerceCommonI18NService
- Parameters:
currency
- the currency to be set as a current currency.
-
getCurrentLocale
public java.util.Locale getCurrentLocale()
Description copied from interface:CommerceCommonI18NService
Get the current locale- Specified by:
getCurrentLocale
in interfaceCommerceCommonI18NService
- Returns:
- the current currency
-
getLocaleForLanguage
public java.util.Locale getLocaleForLanguage(LanguageModel language)
Description copied from interface:CommerceCommonI18NService
Get the site specific locale for the specified language- Specified by:
getLocaleForLanguage
in interfaceCommerceCommonI18NService
- Parameters:
language
- the language- Returns:
- the locale
-
getCurrentLanguage
public LanguageModel getCurrentLanguage()
Description copied from interface:CommerceCommonI18NService
Get the current language- Specified by:
getCurrentLanguage
in interfaceCommerceCommonI18NService
- Returns:
- the current language
-
setCurrentLanguage
public void setCurrentLanguage(LanguageModel language)
Description copied from interface:CommerceCommonI18NService
Set current language.- Specified by:
setCurrentLanguage
in interfaceCommerceCommonI18NService
- Parameters:
language
- the language to be set as a current language.
-
createLocale
protected java.util.Locale createLocale(java.lang.String localeString)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
getI18nService
protected I18NService getI18nService()
-
setI18nService
public void setI18nService(I18NService i18nService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getLocales
protected java.util.Map<java.lang.String,java.util.Locale> getLocales()
-
-