Examples of parseArrayWithType()


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

public class DefaultExtJSONParser_parseArray_2 extends TestCase {

  public void test_0() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("[['1']]");
        parser.config(Feature.AllowISO8601DateFormat, false);
        List<List<Integer>> list = (List<List<Integer>>) parser.parseArrayWithType(new TypeReference<List<List<Integer>>>() {
        }.getType());
        Assert.assertEquals(new Integer(1), list.get(0).get(0));
    }

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

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

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

        Exception error = null;
        try {
            parser.parseArrayWithType(new TypeReference<Map<?, ?>>() {
            }.getType());
        } 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.