[bv-dev] Value extraction open issue #9: extractors for specific parameterized types

Emmanuel Bernard emmanuel at hibernate.org
Tue Jan 17 13:39:10 EST 2017


Like you I think a better support is workable later. Though it looks unnecessary.

> On 17 Jan 2017, at 17:30, Matt Benson <mbenson at apache.org> wrote:
> 
> I am okay with starting out with wildcards only, *unless* anyone can make a convincing argument that this will make it more difficult to support specific type mappings later on.
> 
> Matt
> 
>> On Mon, Jan 16, 2017 at 9:35 AM, Gunnar Morling <gunnar at hibernate.org> wrote:
>> Hi,
>> 
>> Another one from the open issues list: Should we allow extractors to
>> be defined for specific parameterized types, e.g.:
>> 
>>     public class ListOfIntegerExtractor implements
>> ValueExtractor<List<@ExtractedValue Integer>> { ... }
>> 
>>     public class ListOfStringExtractor implements
>> ValueExtractor<List<@ExtractedValue String>> { ... }
>> 
>> Currently, a value extractor may only mark a wild-card type parameter
>> with @ExtractedValue:
>> 
>>     public class ListOfStringExtractor implements
>> ValueExtractor<List<@ExtractedValue ?>> { ... }
>> 
>> The reason being to cut down on complexity and the lack of any use
>> case. Is there any scenario where one would want to extract a list of
>> Integer differently than a list String?
>> 
>> I would thus only support wildcard type parameters in extractor
>> definitions, unless someone else can see a compelling use case for the
>> more liberal model. Note we always can relax the requirement in a
>> future revision.
>> 
>> Thanks,
>> 
>> --Gunnar
>> _______________________________________________
>> beanvalidation-dev mailing list
>> beanvalidation-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
> 
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20170117/0a21aa38/attachment.html 


More information about the beanvalidation-dev mailing list