java.util.ResourceBundle.getBaseBundleName()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中java.util.ResourceBundle.getBaseBundleName方法的一些代码示例,展示了ResourceBundle.getBaseBundleName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceBundle.getBaseBundleName方法的具体详情如下:
包路径:java.util.ResourceBundle
类名称:ResourceBundle
方法名:getBaseBundleName

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());
}

相关文章