Package com.alibaba.fastjson

Examples of com.alibaba.fastjson.JSONReader.endArray()


        Map<String, Object> map = new HashMap<String, Object>();
        reader.readObject(map);

        Assert.assertEquals(123, map.get("id"));

        reader.endArray();

        reader.close();
    }

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


        VO vo = reader.readObject(VO.class);

        Assert.assertEquals(123, vo.getId());

        reader.endArray();

        reader.close();
    }

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

            KeyValue keyValue = reader.readObject(KeyValue.class);
            list.add(keyValue);
        }
        store.setRec(list);
       
        reader.endArray();
       
        reader.endObject();
       
        reader.close();
    }
View Full Code Here

            reader.readObject();
            count++;
        }
        Assert.assertEquals(10, count);

        reader.endArray();
        reader.close();
    }

    public void test_read_1() throws Exception {
        JSONReader reader = new JSONReader(new JSONScanner(text));
View Full Code Here

            reader.readObject();
            count++;
        }
        Assert.assertEquals(10, count);

        reader.endArray();
        reader.close();
    }
   
    public void test_read_3() throws Exception {
        JSONReader reader = new JSONReader(new JSONScanner(text));
View Full Code Here

            reader.endObject();
            count++;
        }
        Assert.assertEquals(10, count);

        reader.endArray();
        reader.close();
    }
}
View Full Code Here

        VO vo = new VO();
        reader.readObject(vo);

        Assert.assertEquals(123, vo.getId());

        reader.endArray();

        reader.close();
    }

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

       
        while (reader.hasNext()) {
            VO vo = reader.readObject(VO.class);
            Assert.assertNotNull(vo);
        }
        reader.endArray();
        reader.close();
    }

    public static class VO {
View Full Code Here

        reader.startArray();
        List<VO> list = reader.readObject(new TypeReference<List<VO>>() {}.getType());
       
        Assert.assertEquals(123, list.get(0).getId());
       
        reader.endArray();
       
        reader.close();
    }
   
    public static class VO {
View Full Code Here

            Assert.assertEquals(100, vo.getScreenHeight());
            Assert.assertEquals(12, vo.getScreenWidth());
            Assert.assertEquals("11", vo.getTag());

        }
        reader.endArray();
        reader.close();
    }

    public static class SectionRequest {
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.