Examples of parseArray()


Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        Assert.assertEquals(new Integer(3), values[2]);
    }

    public void test_11() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1]");
        Object[] array = parser.parseArray(new Type[] { String.class });
        Assert.assertEquals("1", array[0]);
    }

    public void test_12() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("['1']");
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        Assert.assertEquals("1", array[0]);
    }

    public void test_12() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("['1']");
        Object[] array = parser.parseArray(new Type[] { int.class });
        Assert.assertEquals(new Integer(1), array[0]);
    }

    public void test_13() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("['1']");
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        Assert.assertEquals(new Integer(1), array[0]);
    }

    public void test_13() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("['1']");
        Object[] array = parser.parseArray(new Type[] { Integer.class });
        Assert.assertEquals(new Integer(1), array[0]);
    }

    public void test_14() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[]");
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        Assert.assertEquals(new Integer(1), array[0]);
    }

    public void test_14() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[]");
        Object[] array = parser.parseArray(new Type[] {});
        Assert.assertEquals(0, array.length);
    }

    public void test_15() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1,null]");
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

    public void test_15() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1,null]");
        ArrayList list = new ArrayList();
        parser.config(Feature.AllowISO8601DateFormat, false);
        parser.parseArray(String.class, list);
        Assert.assertEquals("1", list.get(0));
        Assert.assertEquals(null, list.get(1));
    }

    public void test_16() throws Exception {
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

    }

    public void test_16() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[[1]]");
        parser.config(Feature.AllowISO8601DateFormat, false);
        Object[] array = parser.parseArray(new Type[] { new TypeReference<List<Integer>>() {
        }.getType() });
        Assert.assertEquals(new Integer(1), ((List<Integer>) (array[0])).get(0));
    }

    public void test_17() throws Exception {
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        Assert.assertEquals(new Integer(1), ((List<Integer>) (array[0])).get(0));
    }

    public void test_17() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[]");
        Object[] array = parser.parseArray(new Type[] { Integer[].class });
        Integer[] values = (Integer[]) array[0];
        Assert.assertEquals(0, values.length);
    }

    public void test_18() throws Exception {
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1,2,null }");
        parser.config(Feature.AllowISO8601DateFormat, false);

        Exception error = null;
        try {
            Object[] array = parser.parseArray(new Type[] { Integer[].class });
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        ArrayList list = new ArrayList();
        parser.config(Feature.AllowISO8601DateFormat, false);

        Exception error = null;
        try {
            parser.parseArray(String.class, list);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here

Examples of com.alibaba.fastjson.parser.DefaultExtJSONParser.parseArray()

        DefaultExtJSONParser parser = new DefaultExtJSONParser("[1,null }");
        parser.config(Feature.AllowISO8601DateFormat, false);

        Exception error = null;
        try {
            parser.parseArray(new Type[] { String.class });
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.