Class StringCSVConverter
java.lang.Object
name.matthewgreet.strutscommons.policy.AbstractPolicySupport<StringCSVConversion>
name.matthewgreet.strutscommons.policy.AbstractCollectionConverterSupport<StringCSVConversion,String>
name.matthewgreet.strutscommons.policy.StringCSVConverter
- All Implemented Interfaces:
CollectionConverter<StringCSVConversion,
,String> Policy<StringCSVConversion>
public class StringCSVConverter
extends AbstractCollectionConverterSupport<StringCSVConversion,String>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns result of conversion of form field.format
(Collection<String> unformattedValues) Returns collection-based field value formatted for display in a form field.Returns message set by annotation.Returns message key set by annotation, which is used to retrieve message from Action's TextProvider if it's not empty string.Returns whether to write any error message to action errors, field errors, or action messages.boolean
Returns whetherCollectionConverter.convert(java.lang.String, java.lang.Class<?>, java.lang.Class<? extends T>)
converts empty string value, andCollectionConverter.format(java.util.Collection<T>)
formats null value or empty collection.Returns item types of recipient collection fields that can receive converted form value.Returns name of field to receive converted form value, which can be empty string to use default.Methods inherited from class name.matthewgreet.strutscommons.policy.AbstractCollectionConverterSupport
makeCollectionForRecipient
Methods inherited from class name.matthewgreet.strutscommons.policy.AbstractPolicySupport
getAnnotation, setAnnotation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface name.matthewgreet.strutscommons.policy.Policy
getAnnotation, setAnnotation
-
Constructor Details
-
StringCSVConverter
public StringCSVConverter()
-
-
Method Details
-
format
Description copied from interface:CollectionConverter
Returns collection-based field value formatted for display in a form field. Not called if the unformatted value is null or empty collection, unlessCollectionConverter.getProcessNoValue()
returns true.- Throws:
Exception
-
getRecipientClass
Description copied from interface:CollectionConverter
Returns item types of recipient collection fields that can receive converted form value. Not to be confused with collection type. -
getMessageType
Description copied from interface:CollectionConverter
Returns whether to write any error message to action errors, field errors, or action messages. -
getMessage
Description copied from interface:CollectionConverter
Returns message set by annotation. Used ifCollectionConverter.getMessageKey()
is empty string or it fails to find a message. -
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. -
getRecipientFieldName
Description copied from interface:CollectionConverter
Returns name of field to receive converted form value, which can be empty string to use default. -
convert
public ConversionResult<String> convert(String formValue, Class<?> recipientFieldClass, Class<? extends String> recipientClass) throws Exception 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, unlessCollectionConverter.getProcessNoValue()
returns true..- Throws:
Exception
-
getProcessNoValue
public boolean getProcessNoValue()Description copied from interface:CollectionConverter
Returns whetherCollectionConverter.convert(java.lang.String, java.lang.Class<?>, java.lang.Class<? extends T>)
converts empty string value, andCollectionConverter.format(java.util.Collection<T>)
formats null value or empty collection.
-