Class MessageFormatWrapper


  • public class MessageFormatWrapper
    extends java.lang.Object
    MessageFormat does not work with classes of the java.time package such as LocalDate This is by design and won't be fixed: https://bugs.openjdk.org/browse/JDK-8016743 This class wraps a MessageFormat and converts classes of the java.time package into Date objects
    Author:
    Guillaume Toison
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String pattern, java.util.Locale locale, java.lang.Object... arguments)  
      • Methods inherited from class java.lang.Object

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

      • MessageFormatWrapper

        public MessageFormatWrapper()
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String pattern,
                                              java.util.Locale locale,
                                              java.lang.Object... arguments)
        Parameters:
        pattern - The message pattern, for instance "since {0, date, dd-MM-yy}"
        locale - The locale, must be non-null
        arguments - the message parameters
        Returns:
        the constructed message
        See Also:
        MessageFormat.format(java.lang.Object[],java.lang.StringBuffer, java.text.FieldPosition)