@Override public Object readFrom( Class<Object> clazz, Type type, Annotation[] antns, MediaType mt, MultivaluedMap<String, String> mm, InputStream in) throws IOException, WebApplicationException { BrwsrCtx def = BrwsrCtx.findDefault(HtmlJsonProvider.class); if (clazz.isArray()) { List<Object> res = new ArrayList<Object>(); final Class<?> cmp = clazz.getComponentType(); Models.parse(def, cmp, in, res); Object[] arr = (Object[]) Array.newInstance(cmp, res.size()); return res.toArray(arr); } if (clazz.isAssignableFrom(java.util.List.class) && type instanceof ParameterizedType && ((ParameterizedType) type).getActualTypeArguments().length == 1 && ((ParameterizedType) type).getActualTypeArguments()[0] instanceof Class) { List<Object> res = new ArrayList<Object>(); final Class<?> cmp = (Class<?>) ((ParameterizedType) type).getActualTypeArguments()[0]; Models.parse(def, cmp, in, res); return res; } return Models.parse(def, clazz, in); }