Class DefaultMessageArgConverter

  • All Implemented Interfaces:
    MessageArgConverter

    public class DefaultMessageArgConverter
    extends Object
    implements MessageArgConverter
    Converts several java.time types to Date. MessageFormat unfortunately doesn't understand Calendar or anything else with a time zone.

    If changes are made to the mapped types, this must be reflected in de.codecamp.messages.shared.messageformat.DefaultMessageFormatSupport.

    • Constructor Detail

      • DefaultMessageArgConverter

        public DefaultMessageArgConverter​(Supplier<TimeZone> timeZoneProvider)
    • Method Detail

      • convert

        public Object convert​(Object value,
                              Locale locale)
        Description copied from interface: MessageArgConverter
        Converts message arguments from a type that is used in the application to a type that can be handled by the used messsage format.
        Specified by:
        convert in interface MessageArgConverter
        Parameters:
        value - the original value
        locale - the locale
        Returns:
        the converted value