Class DefaultODataContextLocaleExtractor
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.DefaultODataContextLocaleExtractor
-
- All Implemented Interfaces:
ODataContextLanguageExtractor
public class DefaultODataContextLocaleExtractor extends java.lang.Object implements ODataContextLanguageExtractor
Default implementation ofODataContextLanguageExtractor
-
-
Constructor Summary
Constructors Constructor Description DefaultODataContextLocaleExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancontainsALanguage(java.lang.String language)protected java.util.Optional<java.lang.String>extractContentLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)java.util.LocaleextractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, java.lang.String headerName)Get the Content/Accept Locale based on the given ODataContextjava.util.Optional<java.util.Locale>getAcceptLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)Get the Language based on the given ODataContextprotected ODataLocalizationServicegetODataLocalizationService()voidsetoDataLocalizationService(ODataLocalizationService oDataLocalizationService)
-
-
-
Method Detail
-
extractFrom
public java.util.Locale extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, java.lang.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 java.util.Optional<java.util.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
protected java.util.Optional<java.lang.String> extractContentLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
-
containsALanguage
protected boolean containsALanguage(java.lang.String language)
-
getODataLocalizationService
protected ODataLocalizationService getODataLocalizationService()
-
setoDataLocalizationService
public void setoDataLocalizationService(ODataLocalizationService oDataLocalizationService)
-
-