Interface CollectionConverter<A extends Annotation,T>

All Superinterfaces:
Policy<A>, Validator<A>
All Known Implementing Classes:
AbstractCollectionConverterSupport, AbstractCustomCollectionConverterSupport, IntegerCSVConverter, StringCSVConverter

public interface CollectionConverter<A extends Annotation,T> extends Validator<A>
Interface for form field validators used by AnnotationValidationInterceptor that convert from string values to collections and vice versa.
  • Method Details

    • getRecipientClass

      Class<T> getRecipientClass()
      Returns types of recipient fields that can receive converted form value or, if recipient should be a list, types of entries.
    • format

      String format(Collection<T> unformattedValues)
      Returns collection-based field value formatted for display in a form field. Not called if the unformatted value is null.
    • getRecipientFieldName

      String getRecipientFieldName()
      Returns name of field to receive converted form value, which can be empty string to use default.
    • convert

      ConversionResult<T> convert(String formValue, Class<?> recipientFieldClass, Class<T> recipientClass)
      Returns result of conversion of form field. This is not called if the form value is empty string or null.