Class Language
java.lang.Object
org.exoplatform.services.rest.impl.header.Language
- Direct Known Subclasses:
AcceptLanguage
Reflection for HTTP language tag.
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocaleCreateLocalefrom Language Tag string.Get primary-tag of language tag, e.Get sub-tag of language tag, e.booleanisCompatible(Language other) Check is two Language instance is compatible.toString()
-
Constructor Details
-
Language
Constructs new instance of Language.- Parameters:
locale-Locale
-
-
Method Details
-
getLocale
CreateLocalefrom Language Tag string.- Parameters:
language- string representation of Language Tag See HTTP/1.1 documentation- Returns:
Locale
-
getPrimaryTag
Get primary-tag of language tag, e. g. if Language tag 'en-gb' then 'en' is primary-tag. See HTTP/1.1 documentation- Returns:
- the primary-tag of Language tag
-
getSubTag
Get sub-tag of language tag, e. g. if Language tag 'en-gb' then 'gb' is sub-tag. See HTTP/1.1 documentation- Returns:
- the sub-tag of Language tag
-
getLocale
- Returns:
Locale
-
isCompatible
Check is two Language instance is compatible.- Parameters:
other- checked language- Returns:
- true if given Language is compatible with current false otherwise
-
toString
-