Class ParameterConverters.DateConverter

All Implemented Interfaces:
ParameterConverters.ParameterConverter<String,Date>
Enclosing class:
ParameterConverters

public static class ParameterConverters.DateConverter extends ParameterConverters.FromStringParameterConverter<Date>
Parses value to a Date using an injectable DateFormat (defaults to new SimpleDateFormat("dd/MM/yyyy"))
  • Field Details

    • DEFAULT_FORMAT

      public static final DateFormat DEFAULT_FORMAT
  • Constructor Details

    • DateConverter

      public DateConverter()
    • DateConverter

      public DateConverter(DateFormat dateFormat)
  • Method Details

    • convertValue

      public Date convertValue(String value, Type type)
      Description copied from interface: ParameterConverters.ParameterConverter
      Convert the value from one type to another, for example from a boolean to a String.
      Parameters:
      value - the value to be converted
      type - the type descriptor that supplies extra information about the requested result type
      Returns:
      the converted value