Class DefaultIntegrationLocalizationService
java.lang.Object
de.hybris.platform.integrationservices.service.impl.DefaultIntegrationLocalizationService
- All Implemented Interfaces:
IntegrationLocalizationService
public class DefaultIntegrationLocalizationService
extends Object
implements IntegrationLocalizationService
An implementation of the
IntegrationLocalizationService, which is built on top of CommonI18NService.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves all locales supported by the platformRetrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.protected CommonI18NServicegetSupportedLocale(String isoCode) Retrieves a locale supported by the platform, which corresponds to the specified ISO code.final LocalegetSupportedLocaleForLanguageTag(String isoCode) Creates a Locale for the provided language tag, and verifies that the locale is supported.voidvoidvalidateLocale(Locale locale) Validates the locale language matches corresponds to an existing LanguageModel.
-
Constructor Details
-
DefaultIntegrationLocalizationService
public DefaultIntegrationLocalizationService()
-
-
Method Details
-
getSupportedLocale
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 <a href=https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes">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
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
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
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
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
-
setInternationalizationService
-