Interface ODataContextLanguageExtractor

All Known Implementing Classes:
DefaultODataContextLocaleExtractor

public interface ODataContextLanguageExtractor
Extracts the Locale to be used by odata services from ODataRequest encapsulated by the ODataContext
  • Method Summary

    Modifier and Type
    Method
    Description
    extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, String headerName)
    Get the Content/Accept Locale based on the given ODataContext
    getAcceptLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
    Get the Language based on the given ODataContext
  • Method Details

    • extractFrom

      Locale extractFrom(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, String headerName)
      Get the Content/Accept Locale based on the given ODataContext
      Parameters:
      oDataContext - The ODataContext to be used.
      headerName - The header name to use. For instance: "Content-Language" or "Accept-Language"
      Returns:
      The locale
    • getAcceptLanguage

      Optional<Locale> getAcceptLanguage(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
      Get the Language based on the given ODataContext
      Parameters:
      oDataContext - The ODataContext to be used.
      Returns:
      The Locale found in the "Accept-Language" header