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 Details

    • DefaultODataContextLocaleExtractor

      public DefaultODataContextLocaleExtractor()
  • Method Details

    • extractFrom

      public Locale extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, String headerName)
      Description copied from interface: ODataContextLanguageExtractor
      Get the Content/Accept Locale based on the given ODataContext
      Specified by:
      extractFrom in interface ODataContextLanguageExtractor
      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: ODataContextLanguageExtractor
      Get the Language based on the given ODataContext
      Specified by:
      getAcceptLanguage in interface ODataContextLanguageExtractor
      Parameters:
      oDataContext - The ODataContext to be used.
      Returns:
      The Locale found in the "Accept-Language" header
    • extractContentLanguage

      protected Optional<String> extractContentLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
    • containsALanguage

      protected boolean containsALanguage(String language)
    • getLocalizationService

      protected IntegrationLocalizationService getLocalizationService()
    • setLocalizationService

      public void setLocalizationService(IntegrationLocalizationService service)