Try to use reflect to create an object of a @PathParam annotated param.
But java does not support dynamic object cast like this:
I want to cast obj to what s represents dynamically
Object obj = (obj)new String("");
String s = "java.lang.String" //or other types i want to cast
list.add((s)obj);