Class AbstractFormatterSupport<A extends Annotation,T>

All Implemented Interfaces:
Converter<A,T>, Policy<A>

public abstract class AbstractFormatterSupport<A extends Annotation,T> extends AbstractConverterSupport<A,T>
Template class for bespoke converters that just format for a view helper. Subclasses must implement Converter.getRecipientClass() and Converter.format(T).
  • Constructor Details

    • AbstractFormatterSupport

      public AbstractFormatterSupport()
  • Method Details

    • convert

      public ConversionResult<T> convert(String fieldValue, Class<? extends T> 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, unless Converter.getProcessNoValue() returns true.
    • 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.
    • getMessageType

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

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

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

      public boolean getProcessNoValue()
      Description copied from interface: Converter
      Returns whether #convert converts empty string value, and #format formats null value.