Class DefaultODataContextLocaleExtractor

    • Constructor Detail

      • DefaultODataContextLocaleExtractor

        public DefaultODataContextLocaleExtractor()
    • Method Detail

      • extractFrom

        public java.util.Locale extractFrom​(org.apache.olingo.odata2.api.processor.ODataContext oDataContext,
                                            java.lang.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 java.util.Optional<java.util.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 java.util.Optional<java.lang.String> extractContentLanguage​(org.apache.olingo.odata2.api.processor.ODataContext oDataContext)
      • containsALanguage

        protected boolean containsALanguage​(java.lang.String language)
      • setoDataLocalizationService

        public void setoDataLocalizationService​(ODataLocalizationService oDataLocalizationService)