Hi all,

This is probably the wrong place, but...

Can anyone explain to me in plain simple English what the genericType
parameter below is good for, please?

public class FooHandler implements ParamConverterProvider {
    @Override
    public <T> ParamConverter<T> getConverter(final Class<T> rawType,
Type genericType, Annotation[] annotations) {

I'm afraid I don't quite understand the JavaDoc from
https://docs.oracle.com/javaee/7/api/javax/ws/rs/ext/ParamConverterProvider.html
- and I couldn't find an example anywhere...

>From the docs:
>> genericType - the type of object to be converted. E.g. if an String value 
>> representing the injected request parameter is to be converted into a method 
>> parameter, this will be the formal type of the method parameter as returned 
>> by Class.getGenericParameterTypes. <<

>From that, I would have expected that for this method signature:
> public Response foo(@MatrixParam("l") List<String> myList) {
genericType would be String?

As in:
>> if an String value ["abc"] representing the injected request parameter 
>> [";l", i.e. ";l=abc"] is to be converted into a method parameter [myList], 
>> this will be the formal type [<String>] of the method parameter 
>> [List<String>] as returned by Class.getGenericParameterTypes. <<

Am I close?

Kind regards,

Christian

Reply via email to