本文整理了Java中java.util.ResourceBundle.getBaseBundleName
方法的一些代码示例,展示了ResourceBundle.getBaseBundleName
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceBundle.getBaseBundleName
方法的具体详情如下:
包路径:java.util.ResourceBundle
类名称:ResourceBundle
方法名:getBaseBundleName
暂无
代码示例来源:origin: com.cedarsoft.commons/javafx
@Nonnull
public static String getString(@Nonnull ResourceBundle resourceBundle, @Nonnull String key) {
try {
return resourceBundle.getString(key);
} catch (MissingResourceException ignore) {
System.err.println("Can't find resource for bundle " + resourceBundle.getBaseBundleName() + ", key " + key);
return key;
}
}
代码示例来源:origin: de.carne/default
/**
* Construct {@code Log}.
*
* @param name The logger name to use.
* @param bundle The {@code ResourceBundle} to use for message localization.
*/
public Log(String name, @Nullable ResourceBundle bundle) {
this.logger = Logger.getLogger(name, (bundle != null ? bundle.getBaseBundleName() : null));
}
代码示例来源:origin: de.carne/common-core
/**
* Construct {@code Log}.
*
* @param clazz The class to derive the log name from.
* @param bundle The (optional) {@link ResourceBundle} to use for message
* localization.
*/
public Log(Class<?> clazz, ResourceBundle bundle) {
this.loggerConfigTime = LogConfig.configTime();
this.logger = Logger.getLogger(clazz.getName(), bundle.getBaseBundleName());
}
代码示例来源:origin: com.cedarsoft.commons/javafx
@Nonnull
public static String get(@Nonnull ResourceBundle resourceBundle, @Nonnull Enum<?> enumValue, @Nullable String category) {
String key = getKey(enumValue, category);
try {
return resourceBundle.getString(key);
} catch (MissingResourceException ignore) {
System.err.println("Can't find resource for bundle " + resourceBundle.getBaseBundleName() + ", key " + key + " in " + enumValue.name());
return key;
}
}
代码示例来源:origin: com.github.vatbub/common.core
@Override
public List<Locale> getLanguagesSupportedByResourceBundle(ResourceBundle bundle) {
return getLanguagesSupportedByResourceBundle(bundle.getBaseBundleName());
}
内容来源于网络,如有侵权,请联系作者删除!