org.springframework.context.support

## 类 DefaultMessageSourceResolvable

- java.lang.Object
- - org.springframework.context.support.DefaultMessageSourceResolvable

- 所有已实现的接口:
    Serializable, MessageSourceResolvable
  直接已知子类:
    ObjectError

      public class DefaultMessageSourceResolvable
      extends Object
      implements MessageSourceResolvable, Serializable

  Spring's default implementation of the `MessageSourceResolvable` interface. Offers an easy way to store all the necessary values needed to resolve a message via a `MessageSource`.
  从以下版本开始:
    13.02.2004
  作者:
    Juergen Hoeller
  另请参阅:
    `MessageSource.getMessage(MessageSourceResolvable, java.util.Locale)`, 序列化表格

- - ### 构造器概要

    构造器
    构造器和说明
    `DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)` Copy constructor: Create a new instance from another resolvable.
    `DefaultMessageSourceResolvable(String code)` Create a new DefaultMessageSourceResolvable.
    `DefaultMessageSourceResolvable(String[] codes)` Create a new DefaultMessageSourceResolvable.
    `DefaultMessageSourceResolvable(String[] codes, Object[] arguments)` Create a new DefaultMessageSourceResolvable.
    `DefaultMessageSourceResolvable(String[] codes, Object[] arguments, String defaultMessage)` Create a new DefaultMessageSourceResolvable.
    `DefaultMessageSourceResolvable(String[] codes, String defaultMessage)` Create a new DefaultMessageSourceResolvable.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | `equals(Object other)`
    `Object[]` | `getArguments()` Return the array of arguments to be used to resolve this message.
    `String` | `getCode()` Return the default code of this resolvable, that is, the last one in the codes array.
    `String[]` | `getCodes()` Return the codes to be used to resolve this message, in the order that they should get tried.
    `String` | `getDefaultMessage()` Return the default message to be used to resolve this message.
    `int` | `hashCode()`
    `protected String` | `resolvableToString()` Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.
    `String` | `toString()` The default implementation exposes the attributes of this MessageSourceResolvable.

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(String code)

      Create a new DefaultMessageSourceResolvable.
      参数:
        `code` - the code to be used to resolve this message

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(String[] codes)

      Create a new DefaultMessageSourceResolvable.
      参数:
        `codes` - the codes to be used to resolve this message

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(String[] codes,
                                                String defaultMessage)

      Create a new DefaultMessageSourceResolvable.
      参数:
        `codes` - the codes to be used to resolve this message
        `defaultMessage` - the default message to be used to resolve this message

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(String[] codes,
                                                Object[] arguments)

      Create a new DefaultMessageSourceResolvable.
      参数:
        `codes` - the codes to be used to resolve this message
        `arguments` - the array of arguments to be used to resolve this message

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(@Nullable
                                                String[] codes,
                                                @Nullable
                                                Object[] arguments,
                                                @Nullable
                                                String defaultMessage)

      Create a new DefaultMessageSourceResolvable.
      参数:
        `codes` - the codes to be used to resolve this message
        `arguments` - the array of arguments to be used to resolve this message
        `defaultMessage` - the default message to be used to resolve this message

    - #### DefaultMessageSourceResolvable

          public DefaultMessageSourceResolvable(MessageSourceResolvable resolvable)

      Copy constructor: Create a new instance from another resolvable.
      参数:
        `resolvable` - the resolvable to copy from

  - ### 方法详细资料

    - #### getCode

          @Nullable
          public String getCode()

      Return the default code of this resolvable, that is, the last one in the codes array.

    - #### getCodes

          @Nullable
          public String[] getCodes()

      从接口复制的说明: `MessageSourceResolvable`
      Return the codes to be used to resolve this message, in the order that they should get tried. The last code will therefore be the default one.
      指定者:
        `getCodes` 在接口中 `MessageSourceResolvable`
      返回:
        a String array of codes which are associated with this message

    - #### getArguments

          @Nullable
          public Object[] getArguments()

      从接口复制的说明: `MessageSourceResolvable`
      Return the array of arguments to be used to resolve this message.

      The default implementation simply returns `null`.

      指定者:
        `getArguments` 在接口中 `MessageSourceResolvable`
      返回:
        an array of objects to be used as parameters to replace placeholders within the message text
      另请参阅:
        `MessageFormat`

    - #### getDefaultMessage

          @Nullable
          public String getDefaultMessage()

      从接口复制的说明: `MessageSourceResolvable`
      Return the default message to be used to resolve this message.

      The default implementation simply returns `null`. Note that the default message may be identical to the primary message code (`MessageSourceResolvable.getCodes()`), which effectively enforces `AbstractMessageSource.setUseCodeAsDefaultMessage(boolean)` for this particular message.

      指定者:
        `getDefaultMessage` 在接口中 `MessageSourceResolvable`
      返回:
        the default message, or `null` if no default

    - #### resolvableToString

          protected final String resolvableToString()

      Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.

    - #### toString

          public String toString()

      The default implementation exposes the attributes of this MessageSourceResolvable.

      To be overridden in more specific subclasses, potentially including the resolvable content through `resolvableToString()`.

      覆盖:
        `toString` 在类中 `Object`
      另请参阅:
        `resolvableToString()`

    - #### equals

          public boolean equals(Object other)

      覆盖:
        `equals` 在类中 `Object`

    - #### hashCode

          public int hashCode()

      覆盖:
        `hashCode` 在类中 `Object`