org.springframework.context.support

## 类 MessageSourceResourceBundle

- java.lang.Object
- - java.util.ResourceBundle
  - - org.springframework.context.support.MessageSourceResourceBundle

-     public class MessageSourceResourceBundle
      extends ResourceBundle

  Helper class that allows for accessing a Spring `MessageSource` as a `ResourceBundle`. Used for example to expose a Spring MessageSource to JSTL web views.
  从以下版本开始:
    27.02.2003
  作者:
    Juergen Hoeller
  另请参阅:
    `MessageSource`, `ResourceBundle`, `org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext`

- - ### 嵌套类概要

    - ### 从类继承的嵌套类/接口 java.util.ResourceBundle

      `ResourceBundle.Control`

  - ### 字段概要

    - ### 从类继承的字段 java.util.ResourceBundle

      `parent`

  - ### 构造器概要

    构造器
    构造器和说明
    `MessageSourceResourceBundle(MessageSource source, Locale locale)` Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
    `MessageSourceResourceBundle(MessageSource source, Locale locale, ResourceBundle parent)` Create a new MessageSourceResourceBundle for the given MessageSource and Locale.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `containsKey(String key)` This implementation checks whether the target MessageSource can resolve a message for the given key, translating `NoSuchMessageException` accordingly.
    `Enumeration<String>` | `getKeys()` This implementation throws `UnsupportedOperationException`, as a MessageSource does not allow for enumerating the defined message codes.
    `Locale` | `getLocale()` This implementation exposes the specified Locale for introspection through the standard `ResourceBundle.getLocale()` method.
    `protected Object` | `handleGetObject(String key)` This implementation resolves the code in the MessageSource.

    - ### 从类继承的方法 java.util.ResourceBundle

      `clearCache, clearCache, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getObject, getString, getStringArray, handleKeySet, keySet, setParent`

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

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

- - ### 构造器详细资料

    - #### MessageSourceResourceBundle

          public MessageSourceResourceBundle(MessageSource source,
                                             Locale locale)

      Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
      参数:
        `source` - the MessageSource to retrieve messages from
        `locale` - the Locale to retrieve messages for

    - #### MessageSourceResourceBundle

          public MessageSourceResourceBundle(MessageSource source,
                                             Locale locale,
                                             ResourceBundle parent)

      Create a new MessageSourceResourceBundle for the given MessageSource and Locale.
      参数:
        `source` - the MessageSource to retrieve messages from
        `locale` - the Locale to retrieve messages for
        `parent` - the parent ResourceBundle to delegate to if no local message found

  - ### 方法详细资料

    - #### handleGetObject

          @Nullable
          protected Object handleGetObject(String key)

      This implementation resolves the code in the MessageSource. Returns `null` if the message could not be resolved.
      指定者:
        `handleGetObject` 在类中 `ResourceBundle`

    - #### containsKey

          public boolean containsKey(String key)

      This implementation checks whether the target MessageSource can resolve a message for the given key, translating `NoSuchMessageException` accordingly. In contrast to ResourceBundle's default implementation in JDK 1.6, this does not rely on the capability to enumerate message keys.
      覆盖:
        `containsKey` 在类中 `ResourceBundle`

    - #### getKeys

          public Enumeration<String> getKeys()

      This implementation throws `UnsupportedOperationException`, as a MessageSource does not allow for enumerating the defined message codes.
      指定者:
        `getKeys` 在类中 `ResourceBundle`

    - #### getLocale

          public Locale getLocale()

      This implementation exposes the specified Locale for introspection through the standard `ResourceBundle.getLocale()` method.
      覆盖:
        `getLocale` 在类中 `ResourceBundle`