本文整理匯總了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");
}
}
示例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;
}
示例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);