History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WAFFLE-68
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mauro Talevi
Reporter: Mauro Talevi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Waffle

Add common type ValueConverters to waffle-core

Created: 15/Apr/08 11:36 AM   Updated: 19/Apr/08 08:12 AM
Component/s: Core
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified


 Description  « Hide
Commonly required ValueConverters are those handling Date and List objects.

Add DateValueConverter and ListValueConverter to o.c.w.bind.converters package, which can optionally be configured in the web.xml like any other ValueConverter.

Both converters are i18n-enabled (for configuration and error messages).

The DateValueConverter message keys and defaults are:
"bind.error.date.missing", "Missing date value for field {0}"
"bind.error.date.invalid", "Invalid date {1} (using format {2}) for field {0}"
"date.format", "dd/MM/yyyy"

The ListValueConverter message keys are:
"bind.error.list.missing", "Missing list value for field {0}"

The ListValueConverter will also check if the list values are parseable to integers and doubles and if so will return a list of the appropriate types. If not it will return a list of string values.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Mauro Talevi - 19/Apr/08 08:12 AM
Refactored converters to return null by default for missing values, but allow behaviour to be overridden to throw a bind exception.