org.springframework.core.io.support

## 类 LocalizedResourceHelper

- java.lang.Object
- - org.springframework.core.io.support.LocalizedResourceHelper

-     public class LocalizedResourceHelper
      extends Object

  Helper class for loading a localized resource, specified through name, extension and current locale.
  从以下版本开始:
    1.2.5
  作者:
    Juergen Hoeller

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `DEFAULT_SEPARATOR` The default separator to use in-between file name parts: an underscore.

  - ### 构造器概要

    构造器
    构造器和说明
    `LocalizedResourceHelper()` Create a new LocalizedResourceHelper with a DefaultResourceLoader.
    `LocalizedResourceHelper(ResourceLoader resourceLoader)` Create a new LocalizedResourceHelper with the given ResourceLoader.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `Resource` | `findLocalizedResource(String name, String extension, Locale locale)` Find the most specific localized resource for the given name, extension and locale: The file will be searched with locations in the following order, similar to `java.util.ResourceBundle`'s search order: [name]_[language]_[country]_[variant][extension] [name]_[language]_[country][extension] [name]_[language][extension] [name][extension] If none of the specific files can be found, a resource descriptor for the default location will be returned.
    `void` | `setSeparator(String separator)` Set the separator to use in-between file name parts.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### DEFAULT_SEPARATOR

          public static final String DEFAULT_SEPARATOR

      The default separator to use in-between file name parts: an underscore.
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### LocalizedResourceHelper

          public LocalizedResourceHelper()

      Create a new LocalizedResourceHelper with a DefaultResourceLoader.
      另请参阅:
        `DefaultResourceLoader`

    - #### LocalizedResourceHelper

          public LocalizedResourceHelper(ResourceLoader resourceLoader)

      Create a new LocalizedResourceHelper with the given ResourceLoader.
      参数:
        `resourceLoader` - the ResourceLoader to use

  - ### 方法详细资料

    - #### setSeparator

          public void setSeparator(@Nullable
                                   String separator)

      Set the separator to use in-between file name parts. Default is an underscore ("_").

    - #### findLocalizedResource

          public Resource findLocalizedResource(String name,
                                                String extension,
                                                @Nullable
                                                Locale locale)

      Find the most specific localized resource for the given name, extension and locale:

      The file will be searched with locations in the following order, similar to `java.util.ResourceBundle`'s search order:

      - [name]_[language]_[country]_[variant][extension]
      - [name]_[language]_[country][extension]
      - [name]_[language][extension]
      - [name][extension]

      If none of the specific files can be found, a resource descriptor for the default location will be returned.

      参数:
        `name` - the name of the file, without localization part nor extension
        `extension` - the file extension (e.g. ".xls")
        `locale` - the current locale (may be `null`)
      返回:
        the most specific localized resource found
      另请参阅:
        `ResourceBundle`