Interface ODataContextLanguageExtractor
-
- All Known Implementing Classes:
DefaultODataContextLocaleExtractor
public interface ODataContextLanguageExtractorExtracts 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.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 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
-
-