org.springframework.context.support.ResourceBundleMessageSource.loadBundle()方法的使用及代码示例

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

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

ResourceBundleMessageSource.loadBundle介绍

[英]Load a property-based resource bundle from the given input stream, picking up the default properties encoding on JDK 9+.

This will only be called with #setDefaultEncodingset to null, explicitly enforcing the platform default encoding (which is UTF-8 with a ISO-8859-1 fallback on JDK 9+ but configurable through the "java.util.PropertyResourceBundle.encoding" system property). Note that this method can only be called with a ResourceBundle.Control: When running on the JDK 9+ module path where such control handles are not supported, any overrides in custom subclasses will effectively get ignored.

The default implementation returns a PropertyResourceBundle.
[中]从给定的输入流中加载一个基于属性的资源包,选择JDK 9+上的默认属性编码。
这将只在#setDefaultEncodingset为null时调用,显式强制执行平台默认编码(这是UTF-8,在JDK 9+上有ISO-8859-1回退,但可通过“java.util.PropertyResourceBundle.encoding”系统属性进行配置)。请注意,此方法只能通过ResourceBundle调用。控件:在JDK 9+模块路径上运行时,如果不支持此类控件句柄,则自定义子类中的任何重写都将被忽略。
默认实现返回PropertyResourceBundle。

代码示例

代码示例来源:origin: spring-projects/spring-framework

if (encoding != null) {
  try (InputStreamReader bundleReader = new InputStreamReader(inputStream, encoding)) {
    return loadBundle(bundleReader);
    return loadBundle(bundleStream);

代码示例来源:origin: org.springframework/spring-context

if (encoding != null) {
  try (InputStreamReader bundleReader = new InputStreamReader(inputStream, encoding)) {
    return loadBundle(bundleReader);
    return loadBundle(bundleStream);

代码示例来源:origin: apache/servicemix-bundles

if (encoding != null) {
  try (InputStreamReader bundleReader = new InputStreamReader(inputStream, encoding)) {
    return loadBundle(bundleReader);
    return loadBundle(bundleStream);

相关文章

微信公众号

最新文章

更多