Class DefaultODataContextLocaleExtractor
java.lang.Object
de.hybris.platform.odata2services.odata.persistence.DefaultODataContextLocaleExtractor
- All Implemented Interfaces:
ODataContextLanguageExtractor
public class DefaultODataContextLocaleExtractor
extends Object
implements ODataContextLanguageExtractor
Default implementation of
ODataContextLanguageExtractor-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontainsALanguage(String language) extractContentLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext) extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, String headerName) Get the Content/Accept Locale based on the given ODataContextgetAcceptLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext) Get the Language based on the given ODataContextprotected IntegrationLocalizationServicevoid
-
Constructor Details
-
DefaultODataContextLocaleExtractor
public DefaultODataContextLocaleExtractor()
-
-
Method Details
-
extractFrom
public Locale extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, String headerName) Description copied from interface:ODataContextLanguageExtractorGet the Content/Accept Locale based on the given ODataContext- Specified by:
extractFromin interfaceODataContextLanguageExtractor- Parameters:
oDataContext- The ODataContext to be used.headerName- The header name to use. For instance: "Content-Language" or "Accept-Language"- Returns:
- The locale
-
getAcceptLanguage
public Optional<Locale> getAcceptLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext) Description copied from interface:ODataContextLanguageExtractorGet the Language based on the given ODataContext- Specified by:
getAcceptLanguagein interfaceODataContextLanguageExtractor- Parameters:
oDataContext- The ODataContext to be used.- Returns:
- The Locale found in the "Accept-Language" header
-
extractContentLanguage
-
containsALanguage
-
getLocalizationService
-
setLocalizationService
-