Method listSetter = ReflectionBasedNullHandler.findMethod(listHolder.getClass(), "set"
+ Info.capitalize(listPropertyName), target.getClass(), null);
Type[] types = listSetter.getGenericParameterTypes();
Type type = types[0];
if (!(type instanceof ParameterizedType)) {
throw new VRaptorException("Vraptor does not support non-generic collection at "
+ listSetter.getName());
}
Class typeToInstantiate = (Class) ((ParameterizedType) type).getActualTypeArguments()[0];
Constructor constructor = typeToInstantiate.getDeclaredConstructor();
constructor.setAccessible(true);