Class AbstractCollectionFormatterSupport<A extends Annotation,T>

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

public abstract class AbstractCollectionFormatterSupport<A extends Annotation,T> extends AbstractCollectionConverterSupport<A,T>
Template class for bespoke converters that just format for a view helper. Subclasses must implement CollectionConverter.getRecipientClass() and CollectionConverter.format(java.util.Collection<T>).
  • Constructor Details

    • AbstractCollectionFormatterSupport

      public AbstractCollectionFormatterSupport()
  • Method Details

    • convert

      public ConversionResult<T> convert(String formValue, Class<?> recipientFieldClass, Class<? extends T> recipientClass)
      Description copied from interface: CollectionConverter
      Returns result of conversion of form field. This is not called if the form value is empty string or null, unless CollectionConverter.getProcessNoValue() returns true..
    • getRecipientFieldName

      public String getRecipientFieldName()
      Description copied from interface: CollectionConverter
      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: CollectionConverter
      Returns whether to write any error message to action errors, field errors, or action messages.
    • getMessage

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

      public String getMessageKey()
      Description copied from interface: CollectionConverter
      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: CollectionConverter
      Returns whether #convert converts empty string value, and #format formats null value or empty collection.