|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.httpgw.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 String |
cvLocalizedResource
The resource to be utilized to determine the Windchill Supported Locales |
private String |
lang
|
private double |
qualityValue
|
private static String |
RESOURCE
|
private static String |
versionID
|
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 Locale |
getDefaultLocale(Vector preferences)
This method is used to construct a Locale object based solely on the accept_language header sent by the browser. |
String |
getLanguage()
Returns the language string of the LanguagePreference object. |
static Locale |
getLocale(String aLanguageList)
This method will take a String of languages obtained from the request Accept-Language attribute and decide the most appropriate Windchill Supported Locale from the given set of languages. |
static Locale |
getLocale(Vector preferences)
This method will take a Vector of languages obtained from the request Accept-Language attribute and decide the most appropriate Windchill Supported Locale from the given set of languages. |
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 versionID
private static final String RESOURCE
private static final String cvLocalizedResource
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 WTException
HTTPAcceptLanguage
- String received from an HTTP request holding the Accept-Language value.
WTException
- Thrown if a parsing error occurs.public static Locale getLocale(Vector preferences)
getLocale( getAcceptLanguagePreferences( request.getHeader("Accept-Language") ) );
preferences
- The Vector list of languages from the browsers's
Accept-Language
attribute.
public static Locale getLocale(String aLanguageList)
getLocale( request.getHeader("Accept-Language") );
aLanguageList
- The list of languages from the browsers's
Accept-Language
attribute.
public static Locale getDefaultLocale(Vector preferences) throws WTException
WTException
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |