|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.util.LanguagePreference
LanguagePreference contains methods used to parse HTTP Accept-Language
strings and retrieve the 'sub-parts' of the strings.
These methods are for use when localizing a response to a
client HTTP request.
Supported API: true
Extendable: false
Field Summary | |
private static Hashtable |
defaultLanguageEncoding
|
private String |
lang
|
private double |
qualityValue
|
private static String |
RESOURCE
|
Constructor Summary | |
LanguagePreference()
Supported API: true |
|
LanguagePreference(String language,
double qvalue)
Supported API: true |
Method Summary | |
static Vector |
getAcceptLanguagePreferences(String HTTPAcceptLanguage)
getAcceptLanguagePreferences parses the HTTPAcceptLanguage string and builds a Vector of String objects to return. |
static String |
getEncoding(Locale locale)
Returns the url encoding for the specified locale. |
String |
getLanguage()
Returns the language string of the LanguagePreference object. |
static Locale |
getLocale(Vector preferences)
Returns the Locale object for the most preferred language. |
double |
getQualityValue()
Returns the qualtityValue of the LanguagePreference object. |
static void |
main(String[] args)
Supported API: false |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static Hashtable defaultLanguageEncoding
private String lang
private double qualityValue
Constructor Detail |
public LanguagePreference()
public LanguagePreference(String language, double qvalue)
Method Detail |
public double getQualityValue()
public String getLanguage()
public static Vector getAcceptLanguagePreferences(String HTTPAcceptLanguage) throws IEException
HTTPAcceptLanguage
- String received from an HTTP request
holding the Accept-Language value.
IEException
- Thrown if a parsing error occurs.public static Locale getLocale(Vector preferences)
preferences
- Vector object holding language strings in the order
of preference.
public static String getEncoding(Locale locale)
locale
- Current locale
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |