org.springframework.beans.propertyeditors

## 类 ResourceBundleEditor

- java.lang.Object
- - java.beans.PropertyEditorSupport
  - - org.springframework.beans.propertyeditors.ResourceBundleEditor

- 所有已实现的接口:
    PropertyEditor

      public class ResourceBundleEditor
      extends PropertyEditorSupport

  `PropertyEditor` implementation for standard JDK `ResourceBundles`.

  Only supports conversion from a String, but not to a String. Find below some examples of using this class in a (properly configured) Spring container using XML-based metadata:

       <bean id="errorDialog" class="...">
          <!--
              the 'messages' property is of type java.util.ResourceBundle.
              the 'DialogMessages.properties' file exists at the root of the CLASSPATH
          -->
          <property name="messages" value="DialogMessages"/>
       </bean>

       <bean id="errorDialog" class="...">
          <!--
              the 'DialogMessages.properties' file exists in the 'com/messages' package
          -->
          <property name="messages" value="com/messages/DialogMessages"/>
       </bean>

  A 'properly configured' Spring `container` might contain a `CustomEditorConfigurer` definition such that the conversion can be effected transparently:

       <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
          <property name="customEditors">
              <map>
                  <entry key="java.util.ResourceBundle">
                      <bean class="org.springframework.beans.propertyeditors.ResourceBundleEditor"/>
                  </entry>
              </map>
          </property>
       </bean>

  Please note that this `PropertyEditor` is not registered by default with any of the Spring infrastructure.

  Thanks to David Leal Valmana for the suggestion and initial prototype.

  从以下版本开始:
    2.0
  作者:
    Rick Evans, Juergen Hoeller

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `BASE_NAME_SEPARATOR` The separator used to distinguish between the base name and the locale (if any) when `converting from a String`.

  - ### 构造器概要

    构造器
    构造器和说明
    `ResourceBundleEditor()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `setAsText(String text)`

    - ### 从类继承的方法 java.beans.PropertyEditorSupport

      `addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor`

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

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

- - ### 字段详细资料

    - #### BASE_NAME_SEPARATOR

          public static final String BASE_NAME_SEPARATOR

      The separator used to distinguish between the base name and the locale (if any) when `converting from a String`.
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### ResourceBundleEditor

          public ResourceBundleEditor()

  - ### 方法详细资料

    - #### setAsText

          public void setAsText(String text)
                         throws IllegalArgumentException

      指定者:
        `setAsText` 在接口中 `PropertyEditor`
      覆盖:
        `setAsText` 在类中 `PropertyEditorSupport`
      抛出:
        `IllegalArgumentException`