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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Locale extractFrom​(org.apache.olingo.odata2.api.processor.ODataContext oDataContext, java.lang.String headerName)
      Get the Content/Accept Locale based on the given ODataContext
      java.util.Optional<java.util.Locale> getAcceptLanguage​(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
      Get the Language based on the given ODataContext
    • Method Detail

      • extractFrom

        java.util.Locale extractFrom​(org.apache.olingo.odata2.api.processor.ODataContext oDataContext,
                                     java.lang.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

        java.util.Optional<java.util.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