Class AbstractCustomCollectionFormatterSupport<T>
java.lang.Object
name.matthewgreet.strutscommons.policy.AbstractPolicySupport<CustomCollectionConversion>
name.matthewgreet.strutscommons.policy.AbstractCollectionConverterSupport<CustomCollectionConversion,T>
name.matthewgreet.strutscommons.policy.AbstractCustomCollectionConverterSupport<T>
name.matthewgreet.strutscommons.policy.AbstractCustomCollectionFormatterSupport<T>
- All Implemented Interfaces:
CollectionConverter<CustomCollectionConversion,
,T> Policy<CustomCollectionConversion>
public abstract class AbstractCustomCollectionFormatterSupport<T>
extends AbstractCustomCollectionConverterSupport<T>
Template class for client supplied converters to collection-based data types that just format for a view helper.
Subclasses must implement
CollectionConverter.getRecipientClass()
and CollectionConverter.format(java.util.Collection<T>)
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns result of conversion of 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 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.CollectionConverter
format, getRecipientClass
Methods inherited from interface name.matthewgreet.strutscommons.policy.Policy
getAnnotation, setAnnotation
-
Constructor Details
-
AbstractCustomCollectionFormatterSupport
public AbstractCustomCollectionFormatterSupport()
-
-
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, unlessCollectionConverter.getProcessNoValue()
returns true.. -
getRecipientFieldName
Description copied from interface:CollectionConverter
Returns name of field to receive converted form value, which can be empty string to use default.- Specified by:
getRecipientFieldName
in interfaceCollectionConverter<CustomCollectionConversion,
T> - Overrides:
getRecipientFieldName
in classAbstractCustomCollectionConverterSupport<T>
-
getMessageType
Description copied from interface:CollectionConverter
Returns whether to write any error message to action errors, field errors, or action messages.- Specified by:
getMessageType
in interfaceCollectionConverter<CustomCollectionConversion,
T> - Overrides:
getMessageType
in classAbstractCustomCollectionConverterSupport<T>
-
getMessage
Description copied from interface:CollectionConverter
Returns message set by annotation. Used ifCollectionConverter.getMessageKey()
is empty string or it fails to find a message.- Specified by:
getMessage
in interfaceCollectionConverter<CustomCollectionConversion,
T> - Overrides:
getMessage
in classAbstractCustomCollectionConverterSupport<T>
-
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.- Specified by:
getMessageKey
in interfaceCollectionConverter<CustomCollectionConversion,
T> - Overrides:
getMessageKey
in classAbstractCustomCollectionConverterSupport<T>
-
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.- Specified by:
getProcessNoValue
in interfaceCollectionConverter<CustomCollectionConversion,
T> - Overrides:
getProcessNoValue
in classAbstractCustomCollectionConverterSupport<T>
-