Class DefaultIntegrationLocalizationService
- java.lang.Object
-
- de.hybris.platform.integrationservices.service.impl.DefaultIntegrationLocalizationService
-
- All Implemented Interfaces:
IntegrationLocalizationService
public class DefaultIntegrationLocalizationService extends java.lang.Object implements IntegrationLocalizationService
An implementation of theIntegrationLocalizationService, which is built on top ofCommonI18NService.
-
-
Constructor Summary
Constructors Constructor Description DefaultIntegrationLocalizationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.util.Locale>getAllSupportedLocales()Retrieves all locales supported by the platformjava.util.LocalegetDefaultLocale()Retrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.protected CommonI18NServicegetInternationalizationService()java.util.Optional<java.util.Locale>getSupportedLocale(java.lang.String isoCode)Retrieves a locale supported by the platform, which corresponds to the specified ISO code.java.util.LocalegetSupportedLocaleForLanguageTag(java.lang.String isoCode)Creates a Locale for the provided language tag, and verifies that the locale is supported.voidsetInternationalizationService(CommonI18NService service)voidvalidateLocale(java.util.Locale locale)Validates the locale language matches corresponds to an existing LanguageModel.
-
-
-
Method Detail
-
getSupportedLocale
public java.util.Optional<java.util.Locale> getSupportedLocale(java.lang.String isoCode)
Description copied from interface:IntegrationLocalizationServiceRetrieves a locale supported by the platform, which corresponds to the specified ISO code.- Specified by:
getSupportedLocalein interfaceIntegrationLocalizationService- Parameters:
isoCode- an ISO code, for which aLocaleshould be retrieved.- Returns:
- an
Optionalcontaining theLocale, if the ISO code is valid and is supported by the platform; otherwise,Optional.empty()is returned.
-
getSupportedLocaleForLanguageTag
public final java.util.Locale getSupportedLocaleForLanguageTag(java.lang.String isoCode)
Description copied from interface:IntegrationLocalizationServiceCreates a Locale for the provided language tag, and verifies that the locale is supported. Implementations are expected to throw an exception if the langaugeTag is not supported.- Specified by:
getSupportedLocaleForLanguageTagin interfaceIntegrationLocalizationService- Parameters:
isoCode- - language tag that holds information used to construct a Locale- Returns:
- - a supported Locale for the languageTag
-
validateLocale
public void validateLocale(java.util.Locale locale)
Description copied from interface:IntegrationLocalizationServiceValidates the locale language matches corresponds to an existing LanguageModel.- Specified by:
validateLocalein interfaceIntegrationLocalizationService- Parameters:
locale- - the locale that is being validated
-
getAllSupportedLocales
public java.util.Collection<java.util.Locale> getAllSupportedLocales()
Description copied from interface:IntegrationLocalizationServiceRetrieves all locales supported by the platform- Specified by:
getAllSupportedLocalesin interfaceIntegrationLocalizationService- Returns:
- a list of all locales, which could be used with integration objects data.
-
getDefaultLocale
public java.util.Locale getDefaultLocale()
Retrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.- Specified by:
getDefaultLocalein interfaceIntegrationLocalizationService- Returns:
- the current language locale in the commerce suite, i.e.
CommonI18NService.getCurrentLanguage()orLocale.ENGLISH, if current language in the system isnull.
-
getInternationalizationService
protected CommonI18NService getInternationalizationService()
-
setInternationalizationService
public void setInternationalizationService(CommonI18NService service)
-
-