[ 
http://jira.codehaus.org/browse/JBEHAVE-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=245814#action_245814
 ] 

Daniel Godfrey commented on JBEHAVE-398:
----------------------------------------

Creating a ListConverter which takes a delegate ParameterConverter in the 
constructor still entails boilerplate and also means I can't then (easily) use 
a @AsParameterConverter method as the delegate. The ListConverter I pushed 
solves all of this and works for List<T> where T can be any Class, by 
delegating back to ParametersConverters to do the actual conversion.

I only renamed ParametersConverters -> DefaultParametersConverters and 
extracted the interface, so I could mock the interface when testing some of the 
ParameterConverters. Just made the testing a bit easier. 

I also pushed a follow-up patch that adds a ParameterTable, which wraps an 
ExamplesTable, providing access to converting the cells into other types, again 
using the existing ParametersConverters. I tried just injecting an instance of 
ParametersConverters using Guice, but it didn't include any of my 
@AsParameterConverter conversions, only the default ones.

> Provide generic parameter conversion to List<T>
> -----------------------------------------------
>
>                 Key: JBEHAVE-398
>                 URL: http://jira.codehaus.org/browse/JBEHAVE-398
>             Project: JBehave
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.1.2
>            Reporter: Daniel Godfrey
>            Priority: Minor
>
> Currently to convert into a List<SomeType> it's necessary to register a 
> custom ParameterConverter. By default it already provides the ability to 
> convert into List<String> and List<subtype of Number>, but this should be 
> extended to support all instances of List<T> as it will reduce the duplicate 
> code necessary.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to