Interface CollectionConverter<A extends Annotation,T>
- All Known Implementing Classes:
AbstractCollectionConverterSupport
,AbstractCustomCollectionConverterSupport
,AbstractCustomCollectionFormatterSupport
,IntegerCSVConverter
,StringCSVConverter
Interface for form field validators used by
AnnotationValidationInterceptor
that convert from string values
to collections and vice versa.-
Method Summary
Modifier and TypeMethodDescriptionReturns result of conversion of form field.format
(Collection<T> unformattedValues) Returns collection-based field value formatted for display in a form field.boolean
Returns whetherconvert(java.lang.String, java.lang.Class<?>, java.lang.Class<? extends T>)
converts empty string value, andformat(java.util.Collection<T>)
formats null value or empty collection.Returns types of recipient fields that can receive converted form value or, if recipient should be a list, types of entries.Returns name of field to receive converted form value, which can be empty string to use default.Methods inherited from interface name.matthewgreet.strutscommons.policy.Policy
getAnnotation, setAnnotation
Methods inherited from interface name.matthewgreet.strutscommons.policy.Validator
getMessage, getMessageKey, getMessageType
-
Method Details
-
convert
ConversionResult<T> convert(String formValue, Class<?> recipientFieldClass, Class<? extends T> recipientClass) throws Exception Returns result of conversion of form field. This is not called if the form value is empty string or null, unlessgetProcessNoValue()
returns true..- Throws:
Exception
-
format
Returns collection-based field value formatted for display in a form field. Not called if the unformatted value is null or empty collection, unlessgetProcessNoValue()
returns true.- Throws:
Exception
-
getRecipientClass
Returns types of recipient fields that can receive converted form value or, if recipient should be a list, types of entries. -
getRecipientFieldName
String getRecipientFieldName()Returns name of field to receive converted form value, which can be empty string to use default. -
getProcessNoValue
boolean getProcessNoValue()Returns whetherconvert(java.lang.String, java.lang.Class<?>, java.lang.Class<? extends T>)
converts empty string value, andformat(java.util.Collection<T>)
formats null value or empty collection.
-