Class Messages


  • public final class Messages
    extends java.lang.Object
    Formats messages.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.concurrent.ConcurrentMap<java.lang.String,​java.text.MessageFormat> messageMap
      Map from message code to MessageFormat object for the message.
      private static java.util.ResourceBundle RESOURCES  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Messages()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private static java.text.MessageFormat findMessage​(java.lang.String code)
      Locates a message by its code.
      static java.lang.String getString​(java.lang.String code)
      Formats a message.
      static java.lang.String getString​(java.lang.String code, java.lang.Object param)
      Deprecated.
      Will be removed in 3.0 in favor of getString(String, Object[]) When removed, calls to this method will automatically recompile to getString(String, Object[])
      static java.lang.String getString​(java.lang.String code, java.lang.Object... params)
      Formats a message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • messageMap

        private static final java.util.concurrent.ConcurrentMap<java.lang.String,​java.text.MessageFormat> messageMap
        Map from message code to MessageFormat object for the message.
      • RESOURCES

        private static final java.util.ResourceBundle RESOURCES
    • Constructor Detail

      • Messages

        private Messages()
    • Method Detail

      • findMessage

        private static java.text.MessageFormat findMessage​(java.lang.String code)
                                                    throws java.util.MissingResourceException
        Locates a message by its code.
        Throws:
        java.util.MissingResourceException
      • getString

        public static java.lang.String getString​(java.lang.String code)
        Formats a message.
        Parameters:
        code - The message code.
        Returns:
        The formatted message.
      • getString

        @Deprecated
        public static java.lang.String getString​(java.lang.String code,
                                                 java.lang.Object param)
        Deprecated.
        Will be removed in 3.0 in favor of getString(String, Object[]) When removed, calls to this method will automatically recompile to getString(String, Object[])
        Formats a message.
        Parameters:
        code - The message code.
        param - The message parameter.
        Returns:
        The formatted message.
      • getString

        public static java.lang.String getString​(java.lang.String code,
                                                 java.lang.Object... params)
        Formats a message.
        Parameters:
        code - The message code.
        params - The message parameters.
        Returns:
        The formatted message.