Package com.alibaba.fastjson.parser

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


        Exception error = null;
        try {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            parser.parseArrayWithType(types[6]);
            ;
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
View Full Code Here


    }

    public void test_18() throws Exception {
        DefaultExtJSONParser parser = new DefaultExtJSONParser("null");
        parser.config(Feature.AllowISO8601DateFormat, false);
        List<Integer> list = (List<Integer>) parser.parseArrayWithType(new TypeReference<List<Integer>>() {
        }.getType());
        Assert.assertEquals(null, list);
    }

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

                                                                 Collection.class, Collection.class);
        Type[] types = method.getGenericParameterTypes();
        {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[0])).get(0) instanceof Map);
        }
        {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[1])).get(0) instanceof User);
View Full Code Here

            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[0])).get(0) instanceof Map);
        }
        {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[1])).get(0) instanceof User);
        }
        {
            Exception error = null;
            try {
                String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
View Full Code Here

        {
            Exception error = null;
            try {
                String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
                DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
                parser.parseArrayWithType(types[2]);
                ;
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
View Full Code Here

            Assert.assertNotNull(error);
        }
        {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[3])).get(0) instanceof User);
        }
        {
            Exception error = null;
            try {
                String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
View Full Code Here

        {
            Exception error = null;
            try {
                String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
                DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
                parser.parseArrayWithType(types[4]);
                ;
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
View Full Code Here

            Assert.assertNotNull(error);
        }
        {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            Assert.assertEquals(true, ((List) parser.parseArrayWithType(types[5])).get(0) instanceof User);
        }

        {
            Exception error = null;
            try {
View Full Code Here

        {
            Exception error = null;
            try {
                String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
                DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
                parser.parseArrayWithType(types[6]);
                ;
            } catch (Exception ex) {
                error = ex;
            }
            Assert.assertNotNull(error);
View Full Code Here

        Exception error = null;
        try {
            String text = "[{\"old\":false,\"name\":\"校长\",\"age\":3,\"salary\":123456789.0123}]";
            DefaultExtJSONParser parser = new DefaultExtJSONParser(text);
            parser.parseArrayWithType(types[6]);
            ;
        } 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.