org.springframework.context.support

Class DefaultMessageSourceResolvable

  • java.lang.Object
    • org.springframework.context.support.DefaultMessageSourceResolvable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object other) 
      java.lang.Object[] getArguments()
      Return the array of arguments to be used to resolve this message.
      java.lang.String getCode()
      Return the default code of this resolvable, that is, the last one in the codes array.
      java.lang.String[] getCodes()
      Return the codes to be used to resolve this message, in the order that they should get tried.
      java.lang.String getDefaultMessage()
      Return the default message to be used to resolve this message.
      int hashCode() 
      protected java.lang.String resolvableToString()
      Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.
      java.lang.String toString()
      The default implementation exposes the attributes of this MessageSourceResolvable.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultMessageSourceResolvable

        public DefaultMessageSourceResolvable(java.lang.String code)
        Create a new DefaultMessageSourceResolvable.
        Parameters:
        code - the code to be used to resolve this message
      • DefaultMessageSourceResolvable

        public DefaultMessageSourceResolvable(java.lang.String[] codes)
        Create a new DefaultMessageSourceResolvable.
        Parameters:
        codes - the codes to be used to resolve this message
      • DefaultMessageSourceResolvable

        public DefaultMessageSourceResolvable(java.lang.String[] codes,
                                              java.lang.String defaultMessage)
        Create a new DefaultMessageSourceResolvable.
        Parameters:
        codes - the codes to be used to resolve this message
        defaultMessage - the default message to be used to resolve this message
      • DefaultMessageSourceResolvable

        public DefaultMessageSourceResolvable(java.lang.String[] codes,
                                              java.lang.Object[] arguments)
        Create a new DefaultMessageSourceResolvable.
        Parameters:
        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
                                              java.lang.String[] codes,
                                              @Nullable
                                              java.lang.Object[] arguments,
                                              @Nullable
                                              java.lang.String defaultMessage)
        Create a new DefaultMessageSourceResolvable.
        Parameters:
        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.
        Parameters:
        resolvable - the resolvable to copy from
    • Method Detail

      • getCode

        @Nullable
        public java.lang.String getCode()
        Return the default code of this resolvable, that is, the last one in the codes array.
      • getCodes

        @Nullable
        public java.lang.String[] getCodes()
        Description copied from interface: 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.
        Specified by:
        getCodes in interface MessageSourceResolvable
        Returns:
        a String array of codes which are associated with this message
      • getArguments

        @Nullable
        public java.lang.Object[] getArguments()
        Description copied from interface: MessageSourceResolvable
        Return the array of arguments to be used to resolve this message.

        The default implementation simply returns null.

        Specified by:
        getArguments in interface MessageSourceResolvable
        Returns:
        an array of objects to be used as parameters to replace placeholders within the message text
        See Also:
        MessageFormat
      • resolvableToString

        protected final java.lang.String resolvableToString()
        Build a default String representation for this MessageSourceResolvable: including codes, arguments, and default message.
      • toString

        public java.lang.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().

        Overrides:
        toString in class java.lang.Object
        See Also:
        resolvableToString()
      • equals

        public boolean equals(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object