private void putArrayValue(Object target, String methodName, JSONValue value)
            throws  JSONException, 
                    NoSuchMethodException, 
                    IllegalAccessException, 
                    InvocationTargetException, 
                    ClassNotFoundException, 
                    InstantiationException {
        JSONArray array = (JSONArray)value;
        
        Method methodInvoke = null;
        Method[] methods = target.getClass().getMethods();
        for (Method method : methods) {
            if (method.getName().equals(methodName)) {
                Class<?>[] params = method.getParameterTypes();
                if (params.length != 1) {
                    throw new JSONException("Parameters do not follow POJO bean conventions");
                } else {
                    Class<?> clazz = Class.forName(params[0].getName());
                    Object put = null;
                    if(List.class.getName().equals(clazz.getName())) {
                        // List Field
                        List<JSONValue> values = array.getValue();
                        put = new ArrayList();
                        // TODO: just strings in lists supported
                        for (JSONValue v : values) {
                            ((List)put).add(((JSONString)v).toString());
                        }
                    } else if(clazz.getComponentType() != null) {
                        // Primitive array
                        put = Array.newInstance(clazz.getComponentType(), array.getValue().size());
                        List<JSONValue> values = array.getValue();
                        int i = 0;
                        for (JSONValue v : values) {
                            Array.set(put, i, ((JSONString)v).getValue().toString());
                            i++;
                        }
                    }
                    methodInvoke = target.getClass().getMethod(methodName, clazz);
                    methodInvoke.invoke(target, put);
                }
            }
        }
    }