gluu
静的公開メンバ関数 | 全メンバ一覧
org.xdi.oxauth.model.util.LocaleUtil クラス
org.xdi.oxauth.model.util.LocaleUtil 連携図
Collaboration graph

静的公開メンバ関数

static Locale localeMatch (List< String > requestedLocales, List< Locale > availableLocales)
 

詳解

著者
Javier Rojas Blum Date: 11.27.2013

関数詳解

◆ localeMatch()

static Locale org.xdi.oxauth.model.util.LocaleUtil.localeMatch ( List< String >  requestedLocales,
List< Locale >  availableLocales 
)
inlinestatic
19  {
20  if (requestedLocales == null || availableLocales == null) {
21  return null;
22  }
23 
24  for (String requestedLocale : requestedLocales) {
25  Locale reqInQuestion = LocaleUtils.toLocale(requestedLocale);
26  List<Locale> lookupList = LocaleUtils.localeLookupList(reqInQuestion);
27 
28  for (Locale localeInQuestion : lookupList) {
29  for (Locale availableLocale : availableLocales) {
30  if (localeInQuestion.equals(availableLocale)) {
31  return availableLocale;
32  }
33  }
34  }
35 
36  for (Locale availableLocale : availableLocales) {
37  if (reqInQuestion.getLanguage().equals(availableLocale.getLanguage())) {
38  return availableLocale;
39  }
40  }
41  }
42 
43  return null;
44  }

このクラス詳解は次のファイルから抽出されました: