Class DefaultMessageArgConverter

java.lang.Object
de.codecamp.messages.runtime.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 Details

    • DefaultMessageArgConverter

      public DefaultMessageArgConverter()
  • Method Details

    • convert

      public Object convert(Object value, Locale locale, ZoneId timeZone)
      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 message format.
      Specified by:
      convert in interface MessageArgConverter
      Parameters:
      value - the original value
      locale - the locale used for conversion
      timeZone - the time zone used for conversion
      Returns:
      the converted value