Annotation Interface CustomCollectionConversion
@Documented
@Inherited
@Target(FIELD)
@Retention(RUNTIME)
public @interface CustomCollectionConversion
Defines a String form field (whether on a Struts Action or model of ModelDriven Struts Action) should be converted
using a client supplied validator to a recipient field of some type of collection and error message to display if
this fails. The custom validator must implement CollectionConverter
, preferably extending
AbstractCustomCollectionConverterSupport
, and have a public constructor accepting an instance of this
annotation.
By default, messages are added to the actionErrors list but this can be overridden by messageType
:
- ERROR
- Message added to Action level error messages. Default.
- FIELD
- Message added to field error messages.
- MESSAGE
- Message added to Action level info messages.
Other parameters
- message
- If not empty string, text message to display. Used if
messageKey
is empty string or finds no message. - messageKey
- If not empty string, message key to retrieve from Action's TextProvider. Uses
message
if no key provided or no message found. - param1
- Parameter recognised by custom validator. Defaults to empty string.
- param2
- Parameter recognised by custom validator. Defaults to empty string.
- param3
- Parameter recognised by custom validator. Defaults to empty string.
- param4
- Parameter recognised by custom validator. Defaults to empty string.
- param5
- Parameter recognised by custom validator. Defaults to empty string.
- parsedFieldName
- If not empty string, name of field to contain parsed value. Defaults to 'parsed' plus capitalised field name, such as 'parsedLimit'.
- validatorClass
- Class of client supplied validator. See notes above.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass
<? extends CollectionConverter<CustomCollectionConversion, ?>> -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescription
-
Element Details
-
message
String message- Default:
""
-
messageKey
String messageKey- Default:
""
-
messageType
Required.MessageType messageType- Default:
ERROR
-
param1
String param1- Default:
""
-
param2
String param2- Default:
""
-
param3
String param3- Default:
""
-
param4
String param4- Default:
""
-
param5
String param5- Default:
""
-
parsedFieldName
String parsedFieldName- Default:
""
-
validatorClass
Class<? extends CollectionConverter<CustomCollectionConversion,?>> validatorClass
-