Class DateConverter

All Implemented Interfaces:
Converter<DateConversion,Date>, Policy<DateConversion>, Validator<DateConversion>

public class DateConverter extends AbstractConverterSupport<DateConversion,Date>
  • Constructor Details

    • DateConverter

      public DateConverter()
  • Method Details

    • getDateFormatStyle

      public static int getDateFormatStyle(DateConversion.Style style)
    • makeDateFormat

      protected DateFormat makeDateFormat()
    • format

      public String format(Date unformattedValue)
      Description copied from interface: Converter
      Returns single field value formatted for display in a form field. Only applies single value recipients. Not called if the unformatted value is null.
    • getRecipientClass

      public Class<Date> getRecipientClass()
      Description copied from interface: Converter
      Returns types of recipient fields that can receive converted form value or, if recipient should be a list, types of entries.
    • getMessageType

      public Required.MessageType getMessageType()
      Description copied from interface: Validator
      Returns whether to write any error message to action errors, field errors, or action messages.
    • getMessage

      public String getMessage()
      Description copied from interface: Validator
      Returns message set by annotation. Used if Validator.getMessageKey() is empty string or it fails to find a message.
    • getMessageKey

      public String getMessageKey()
      Description copied from interface: Validator
      Returns message key set by annotation, which is used to retrieve message from Action's TextProvider if it's not empty string.
    • getRecipientFieldName

      public String getRecipientFieldName()
      Description copied from interface: Converter
      Returns name of field to receive converted form value, which can be empty string to use default.
    • convert

      public ConversionResult<Date> convert(String formValue, Class<Date> recipientClass)
      Description copied from interface: Converter
      Returns result of conversion of form field. This is not called if the form value is empty string or null.