當前位置: 首頁>>代碼示例>>Java>>正文


Java ResourceBundle.Control方法代碼示例

本文整理匯總了Java中java.util.ResourceBundle.Control方法的典型用法代碼示例。如果您正苦於以下問題:Java ResourceBundle.Control方法的具體用法?Java ResourceBundle.Control怎麽用?Java ResourceBundle.Control使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.ResourceBundle的用法示例。


在下文中一共展示了ResourceBundle.Control方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testCandidateLocales

import java.util.ResourceBundle; //導入方法依賴的package包/類
/**
 * Check that candidate locales list retrieved for zh__Hant and for zh__Hans
 * do not have first candidate locale as zh_TW_Hant and zh_CN_Hans
 * respectively.
 */
private static void testCandidateLocales() {
    ResourceBundle.Control Control = ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT);
    Locale zh_Hant = Locale.forLanguageTag("zh-Hant");
    Locale zh_Hans = Locale.forLanguageTag("zh-Hans");
    List<Locale> zhHantCandidateLocs = Control.getCandidateLocales("", zh_Hant);
    List<Locale> zhHansCandidateLocs = Control.getCandidateLocales("", zh_Hans);
    if (!zhHantCandidateLocs.equals(ZH_HANT_CANDLOCS)) {
        reportDifference(zhHantCandidateLocs, ZH_HANT_CANDLOCS, "zh_Hant");

    }
    if (!zhHansCandidateLocs.equals(ZH_HANS_CANDLOCS)) {
        reportDifference(zhHansCandidateLocs, ZH_HANS_CANDLOCS, "zh_Hans");

    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:Bug8167143.java

示例2: getControl

import java.util.ResourceBundle; //導入方法依賴的package包/類
public ResourceBundle.Control getControl(String baseName) {
    System.out.println(getClass().getName()+".getControl called for " + baseName);

    // Throws a NPE if baseName is null.
    if (baseName.startsWith("com.foo.Xml")) {
        System.out.println("\treturns " + XMLCONTROL);
        return XMLCONTROL;
    }
    System.out.println("\treturns null");
    return null;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:UserControlProvider.java

示例3: getControl

import java.util.ResourceBundle; //導入方法依賴的package包/類
/**
 * Returns a {@code ResourceBundle.Control} instance that is used
 * to handle resource bundle loading for the given {@code
 * baseName}. This method must return {@code null} if the given
 * {@code baseName} isn't handled by this provider.
 *
 * @param baseName the base name of the resource bundle
 * @return a {@code ResourceBundle.Control} instance,
 *         or {@code null} if the given {@code baseName} is not
 *         applicable to this provider.
 * @throws NullPointerException if {@code baseName} is {@code null}
 */
public ResourceBundle.Control getControl(String baseName);
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:14,代碼來源:ResourceBundleControlProvider.java


注:本文中的java.util.ResourceBundle.Control方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。